Why is my PIN configured as Input, but still acts as Output?
Hi all
I'm working on Nucleo-F410RB
I have a UV filter that sends back a 0V-5V digital signal that I'm trying to read on PIN D13 (PA5).
The issue if the following (I'm using a multimeter to read the voltage, and all components have a common ground):
- when the cable is not connected to the PIN
- I read a voltage of 5V from the UV filter side
- I read a voltage of 1.7V from the PIN D13 side
- when I connect them both
- I read a voltage of 2V
Even though I can interpret the signal, the imposed voltage on the UV filter makes him go into default mode.
Here is the code I'm using
#define OTH2_GPIO GPIOA
#define OTH2_PIN GPIO_PIN_5
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_6|GPIO_PIN_5|GPIO_PIN_10, GPIO_PIN_RESET);
HAL_GPIO_WritePin(OTH1_GPIO, OTH1_PIN, GPIO_PIN_RESET);
HAL_GPIO_WritePin(OTH2_GPIO, OTH2_PIN, GPIO_PIN_RESET);
GPIO_InitStruct.Pin = OTH2_PIN;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(OTH2_GPIO, &GPIO_InitStruct);
