All of this is for a FRDM-K22F board, but I believe it would be similar for any of the other FRDM boards.
I have a differential signal connected to ADC0_DP0 (J24 pin 1) and ADC0_DM0 (J24 pin 3) and can see a good signal on the scope. However, with the attached code, I basically see the same value all the time. Can someone look over my code to see what I have set up wrong?
To explain the code a little, the AudioInit() routine sets up an ADC section, a DAC section and PIT0. The PIT output does two things - generate an interrupt and trigger the ADC conversion. The interrupt is used to output a value from a sine table to the DAC. That works as expected. The fact that I'm getting the ADC interrupt, tells me that the conversion is getting kicked off by the PIT.
What's not happening is a value representative of my input. So, at this point my conclusion is that either the MUX is not set up correctly for differential input on channel 0, or that I'm not reading the correct result register. I've checked for those and they seem OK. So, either I'm not understanding the hardware correctly or there's something else.
Original Attachment has been moved to: Audio.c.zip