ADC not working on L4

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
mbrej
Posts: 6
Joined: Mon May 23, 2016 4:03 pm

ADC not working on L4

Post by mbrej » Thu Jun 02, 2016 11:23 pm

Hi all, I am trying to get the ADC working on a L4 board.

As a simple test, I have tried running the code pyb.ADC(17).read() which should read the internal temperature sensor and return ~1600, but instead 0 is returned.

I have also tried reading the value of a pin, but this also returned zero. I had to add ,ADC12_INx to the appropriate lines in stm32l476_af.csv to get this to work though.

Any ideas?

Thanks, Matt

shaoziyang
Posts: 303
Joined: Sun Apr 17, 2016 1:55 pm

Re: ADC not working on L4

Post by shaoziyang » Fri Jun 03, 2016 1:37 am

Yes, it is not work in STM32F7DISC too.

mbrej
Posts: 6
Joined: Mon May 23, 2016 4:03 pm

Re: ADC not working on L4

Post by mbrej » Thu Jul 14, 2016 10:44 pm

Ive made a little progress on this: https://github.com/micropython/micropython/issues/2243

User avatar
badi
Posts: 51
Joined: Mon Aug 10, 2015 2:18 pm
Location: Bern, Switzerland

Re: ADC not working on L4

Post by badi » Tue Jul 19, 2016 12:43 pm

Hi

I created a pull request #2252 for fixing this issue.
It would be great if you could test this fix by checking out and compiling l4_adc_bug branch of my repo
https://github.com/tobbad/micropython/tree/l4_adc_bug
If the fix works on your device too, please add some kind of "OK" to Issue #2252.
badi

Post Reply