GPIO read correct data
Hi there !
I start a project with STM32G031k8. This board i'm gonna make is a RS485 slave on the pin 4-5-6-7 of GPIOA i put a dipswitch with pullup resistor , and i read in this way:
uint16_t Add = ( 0x00F0 & GPIOA->IDR)>> 4 ;
right now my add is 5. My problem is sometime i don't read 5 but 1 , and if i don't turn off the power and turn on again i'm still to read 1 .
I hope some one can help me to understand where i make my mistake
Thank you
Sergio
