2024-02-07 06:28 AM
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.
2024-02-07 07:34 AM - edited 2024-02-07 07:35 AM
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.
2024-02-07 07:40 AM
> this process carried out by connecting a wire
What wire? Connecting where? Why would that "connecting a wire" pins having different input level?
JW
2024-02-08 03:03 AM
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
2024-02-08 06:34 AM
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.