Page 2 of 2

Re: ADC performance of MicroPython boards

Posted: Wed Nov 18, 2020 6:41 am
by pythoncoder
Interesting. I assume you've seen the figures in the official docs. These were measured on a Pyboard 1.1 and are for read_timed_multi so are just ballpark figures. The comments on IRQ's will still apply.

Note also the boolean result: it would be good if read_timed also produced this.

Re: ADC performance of MicroPython boards

Posted: Mon Feb 22, 2021 7:29 pm
by mironk
I tried the below code, which was referenced on teh forum, on my pyboard v1.1:

http://www.robertocolistete.net/MicroPy ... Pyboard.py

It reached about 1.4 MS/s. The problem is that when I checked the buffer length by "print(len(buf))" it showed that the buffer was not 20000 but 10000. So it is two times shorter than declared. I do not understand it. Does it mean that the actual ADC rate is 0.7 Ms/s ?

Errata: Previously I made a mistake. I wrote 1.4 kS/s and 0.7 kS/s. Of course it is 1.4 MS/s and 0.7 MS/s.

Re: ADC performance of MicroPython boards

Posted: Mon Feb 22, 2021 8:17 pm
by Roberthh
Yes, buf has 10.000 elements. But for the sampling time you should be able to tell if the figure was right. At 1.4ks/s, getting 10000 samples takes about 7 seconds. So you should be able to tell, whether the time is 7 seconds or way shorter. I see that the scripts sets the time frequency to 2MHz. That's fast. Try lower frequencies first, like 100kHz or 10 kHz. That should deliver 10000 samples within one second.