cancel
Showing results for 
Search instead for 
Did you mean: 

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

SSaro.1
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
Peter BENSCH
ST Employee

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
SSaro.1
Associate II

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

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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.