8 years, 9 months ago.

The read result on A5 always 0.

Hi, mbed & ST team

I am using F103RB in one product. I used A5/PC0 as input of reference voltage. However, it always returns 0.

My code:

main.cpp

//AnalogIn refer_2V5(A5);
AnalogIn refer_2V5(PC_0);	// A5

float ref = refer_2V5.read();

I also tried out PC_1/PC_2/PC_3/PC_4. They are working correctly. Only PC_0/A5 returns 0.

I tried run code on NUCLEO as well as many custom boards. PC_0/A5 always 0.

Please give me some advice.

Thanks.

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F103RBT6 microcontroller.

1 Answer

8 years, 9 months ago.

I don't have this problem on my board.

You should check the solder bridges:
SB56 and SB51 should be ON
SB46 and SB52 should be OFF
(see nucleo datasheet p 24/25 for details)

Or maybe you zapped the pin? it is located at the corner of the board...

Accepted Answer

Well, today I tried to read all ADCs from A0 to A5 one by one. All ADC can be read out.

To be frank, I have not found the root cause. But the project is running, and I am moving on to other issues now.

Thanks.

posted by Kai Liu 13 Jul 2015