cancel
Showing results for 
Search instead for 
Did you mean: 

How can i configure pins "PD6 and PD5" of controller "STM8S103F3" in low state (voltage level 0) in "input mode" .

HTiwa.11
Associate II

Hi All,

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.

1 REPLY 1
tinkerBOY
Associate II

Here's an example:

GPIOD->DDR &= ~(1<<3); // Set bit 3 on port D as Input
GPIOD->CR1 |= 1<<3; // Set bit 3 on port D with Pull Up Enabled

//tinkerBOY//..