Skip to main content
Visitor II
February 27, 2020
Question

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

  • February 27, 2020
  • 1 reply
  • 839 views

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.

    This topic has been closed for replies.

    1 reply

    Visitor II
    March 1, 2020

    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//..