Open kevinjwalters opened 2 days ago
I have no actual data on this. I just based this on the Pico datasheet (https://datasheets.raspberrypi.com/pico/pico-datasheet.pdf), where in chapter 4.4 they specifically mention PWM mode "which reduces the output ripple considerably at light loads".
However, from some other documentation (https://pico-adc.markomo.me/) it seems like PWM mode can actually introduce more noise, which is very much the opposite of what it's supposed to do.
Interesting to see your actual testing data, so from what I can tell, it makes no noticable difference? Might be worth just removing that pin change for sakes of improving speed...
I had a go at a CircuitPython implementation of your C code switching to PWM mode and then back to PFM mode after taking the ADC sample. The results are shown in Instructables: Measuring Small Voltages With Pi Pico ADC and Comparison With Microchip MCP3208 Using Cytron EDU PICO. From Step 12 onwards you can see values where the
RP2040 GP27 PFM
values are separated out. For my setup and my code it doesn't appear to make any difference. I've attached one of the plots below where the top four don't use the technique and next four do and they all look very very similar.Do you have some testing for this demonstrating noise improvements?