Skip to main content
Visitor II
March 13, 2022
Solved

[STM8S003F3P6] GPIO(PB5) ouputs 5V when set HIGH using 3.3v power supply[RESOLVED]

  • March 13, 2022
  • 2 replies
  • 2242 views

I am trying to run simple program to output HIGH on IO pin of microcontroller STM8S003F3P6.

I am using PB5 pin to output High. I am using 3.3v power supply and expect GPIO to output 3.3v when I set it HIGH but surprisingly I am getting 5V instead, below is the circuit diagram

0693W00000KcOqWQAV.png 

Can someone help how to get 3.3v instead of 5V on GPIO output for above processor, is there anything wrong with above circuit?

    This topic has been closed for replies.
    Best answer by Peter BENSCH

    Welcome, @SSaro.1​, to the community!

    first of all: the schematic looks good, even if R16 on NRST is not necessary.

    However, it is simply not possible to measure 5V on a pin of a device where nothing is connected to 5V, so you seem to have another connection not shown here. Please measure the voltage at net 3.3v (U7.9 or J23.1).

    Please also include your code (init, GPIO setting) using the code button </> to verify.

    Regards

    /Peter

    2 replies

    Technical Moderator
    March 14, 2022

    Welcome, @SSaro.1​, to the community!

    first of all: the schematic looks good, even if R16 on NRST is not necessary.

    However, it is simply not possible to measure 5V on a pin of a device where nothing is connected to 5V, so you seem to have another connection not shown here. Please measure the voltage at net 3.3v (U7.9 or J23.1).

    Please also include your code (init, GPIO setting) using the code button </> to verify.

    Regards

    /Peter

    SSaro.1Author
    Visitor II
    March 15, 2022

    Thanks, it seems somewhere there was loose connection, but it seems to be working now

    Technical Moderator
    March 15, 2022

    Great!

    If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.

    /Peter