Close

Don't Shoot the Messenger!

A project log for Multislope ADC

Making the most of non-ideal components in a non-ideal world.

nnniNNNI 06/15/2023 at 19:070 Comments

After the successful experiments described in this log, I assumed that my troubles with the ADC were finally over and I was looking forward to seeing some useful readings. 

After I replaced the troublesome and hard-to-find machine pin headers with regular pin headers, the board was ready for its first full power-up in almost 10 months. 

I was glad to see that everything worked just fine. The sample rate of my scope leave something to be desired. 

I set up the code to send a stream of data to my computer through USB serial, logged the charge balancing counts and residue counts before and after, and plotted the residue reading difference in Excel. 

Almost as if I had made no changes to the board, the severe noise and banding was back, and I had no clue what was going on this time. 

I brought out the calculator and elbow grease and manually checked the voltages on the input of the residue ADC, and made some interesting findings. 

The first flat area, which is where the residue ADC makes a measurement of the integrator state before charge balancing, corresponded perfectly with the second residue variable, which is supposed to be the integrator voltage after charge balancing. The pre charge balancing value didn't correspond with the voltage at the ADC input at all. 

This got me thinking. I realized that there was a dummy measurement made as soon as the Pi Pico was powered up, in order to put the state machine in dithering mode. During this time, the residue readings were not read and could possibly be clogging up DMA.

Since I knew the second value being returned was correct, I kept that as such, and moved the first value up by one column in Excel and then plotted the difference. 

To my surprise, the difference now corresponded perfectly with what was expected. Something was causing the first value being returned to be delayed by one reading. I made a crude diagram to show what was going on.

One of my initial suspects was a software bug somewhere in the residue reading process, but it was not where I expected it to be!

Discussions