Page 1 of 1

Analog input 12 bits resolution

Posted: Tue Jun 16, 2020 12:19 pm
by carlo
Hi, I have an F401 blackpill.
I would like to use the 12-bit analog inputs.
I tried how it is used with arduino:
a = analogRead (PA0);
Serial.print (a);
I get a value from 0 to 1023
How to get 0-4095 i.e. a resolution at 12bits.
Thanks

Re: Analog input 12 bits resolution

Posted: Tue Jun 16, 2020 12:30 pm
by fpiSTM

Re: Analog input 12 bits resolution

Posted: Tue Jun 16, 2020 2:45 pm
by carlo
Ok, thanks

Re: Analog input 12 bits resolution

Posted: Tue Jun 16, 2020 2:53 pm
by fpiSTM
carlo wrote:
Tue Jun 16, 2020 2:45 pm
Ok, thanks
Welcome. Sorry for the short answers, I didn't have time to develop.
So simply use the analWriteResolution API and then this will be ok.