cancel
Showing results for 
Search instead for 
Did you mean: 

PA4/SPI_NSS, PA5/SPI1_CLK, PA6/SPI1_MISO

rib.1
Associate II

Hi,
I have a problem with these pins PA4/SPI_NSS, PA5/SPI1_CLK, PA6/SPI1_MISO I programmed the chip so that those pins are a digital input to check for current present(no current = 0/current present = 1) this process carried out by connecting a wire.
and in reality the state of the pins is always 1 even when the cable is disconnected

 

can you please help me solve this problem.

4 REPLIES 4
TDK
Guru

If the pins are floating, they are not guaranteed to be 0 or 1. If you want them to be 0 when nothing is connected, enable the pulldown resistor.

 

> I programmed the chip so that those pins are a digital input to check for current present(no current = 0/current present = 1) this process carried out by connecting a wire.

The logic here doesn't really add up. Are you sure the pins will be a digital 0 when current is present and 0 when not? Perhaps show this.

If you feel a post has answered your question, please click "Accept as Solution".

> this process carried out by connecting a wire

What wire? Connecting where? Why would that "connecting a wire" pins having different input level?

JW

rib.1
Associate II

Hi,
I have used the same logic on  PA7 and PA 12 and they work as expected.
on PA7 i have a normal wire (Ribbon cable female-female) that connected to the VDD from one side and the PA7 on the other.

PA12 is connected to a switch d2fs-fl-n (open-close) same connection as PA7

TDK
Guru

Still not really understanding the logic here.

> on PA7 i have a normal wire (Ribbon cable female-female) that connected to the VDD from one side and the PA7 on the other.

So PA7 is connected to VDD? I don't see how that helps, so I must be misunderstanding something.

 

Main point stands: floating inputs are not guaranteed to be 0 or 1. Assign no significance to their value.

If you feel a post has answered your question, please click "Accept as Solution".