I am using "STM8S103F3" controller. When i am reading the voltage levels on the pins "PD6 and PD5" on startup (no external connection), using "IDR" registers, it is showing voltage level as 1 (5v). I want to know, how i can set the voltage level as "0" on this pins. I already tried "Pull up register" of this controller, for this port pins, but it is not working.
Asked
Active
Viewed 117 times
1 Answers
0
When the pin is left floating like you describe, you cannot expect the input to be a particular value unless you have connected a pull-up or pull-down resistor.
"Pull up register" likely attaches an internal pull-up resistor to the line, pulling it high (to 5v). This is probably not what you want. Glancing at the user manual, that IC does not have internal pull-down on the GPIO ports. If your application REQUIRES pull-down you can do this externally (i.e. with a physical resistor from the pin to GND).

9superswords
- 16
- 1