[Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
meitao605
Posts: 4
Joined: Sat Apr 04, 2020 9:24 am

[Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Post by meitao605 »

Version: STM32 Core 1.8.0
Arduino Verison: 1.8.12
UploadMethod: ST_LINK

Chip:STM32F103RCT6

code:
HardwareSerial Uart1(PA10,PA9);
int fold_current;

void setup() {
pinMode(PC3,INPUT_ANALOG);
Uart1.begin(9600);
}

void loop()
{
fold_current = analogRead(PC3);
Uart1.println(fold_current);
delay(100);
}
After Upload this code, it will stuck and nothing print out from the Uart1.
but works fine and print out the value for other pins, simple replace the PC3 to other pins will work.

the pins i have tried:

PC1
PC2
PC4
PC5
PA1

Hardware: 2 different boards with STM32F103RCT6. one is my self-made boards. another is the AlienTEK develop Boards. which can be found www.alientek.com( MiniSTM32F103 )

I tried to check the pin-Map, it seems OK.
by fpiSTM » Sat Apr 04, 2020 12:18 pm
Hi,

before submitting an issue on GitHub please wait to have an answer.
This is a known issue and already fixed.
viewtopic.php?p=1087#p1087
Go to full post
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: AnalogRead() for PC3 stucked of STM32F103RCT6

Post by fpiSTM »

Hi,

before submitting an issue on GitHub please wait to have an answer.
This is a known issue and already fixed.
viewtopic.php?p=1087#p1087
meitao605
Posts: 4
Joined: Sat Apr 04, 2020 9:24 am

Re: [Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Post by meitao605 »

I'm sorry for that.

I'm very new here, and this is my first time work with Arduino_STM32.

I tried to read the issue, but i don't quite understand 'analogRead: don't set ADC common register when ADC doesn't support it.'

does that mean i can't use this ADC3,or is there another we to get the number except analogRead()?

if it's possible to use ADC3, please help to share a piece of code.

thanks

Mei Tao
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: [Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Post by fpiSTM »

As explained it is fixed. In ghe github issue and in the forum you have the link to the PR which fix this.
It is availabke in the master repo and will be in the next release.
meitao605
Posts: 4
Joined: Sat Apr 04, 2020 9:24 am

Re: [Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Post by meitao605 »

Thanks. very much. :D

now i have to learn how to install from git rather than just download from IDE. :o
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: [Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Post by fpiSTM »

See the wiki for that ;)
meitao605
Posts: 4
Joined: Sat Apr 04, 2020 9:24 am

Re: [Answered] AnalogRead() for PC3 stucked of STM32F103RCT6

Post by meitao605 »

Confirmed, it works.

Thanks.
Post Reply

Return to “General discussion”