I am sampling the ADC function at a rate of 50kHz (I attached an ADC convert function to "Ticker" that calls the ADC function every 20 microseconds). I am grabbing 256 points of data for an FFT, and the ADC samples are _u16 ("unsigned int").
As part of my troubleshooting, I am collecting 256 samples, and then printing them out to hyperterminal to see what values I get.
I have installed a level shifter at the input of the ADC to bias the incoming audio sample at 1.15V (half of the 3.3V reference on the mBed).
With nothing connected to the MBed terminals (except a level shifter), I get the following numbers in the hyperterminal screen:
32743
32695
4294934568
32743
32583
32743
32743 (...etc)
If I am using the "read_u16" command, the max value is 65535, and half of this max is 32768. The "32,000" values I am getting make sense, but where is the 4294934568 value coming from? Is it a hardware error?
Update: When I use the regular read() function (for a float value from 0 to 1.0), all the values are very consistent with 0.5. It seems that only using the read_u16 command can produce invalid results.
I am sampling the ADC function at a rate of 50kHz (I attached an ADC convert function to "Ticker" that calls the ADC function every 20 microseconds). I am grabbing 256 points of data for an FFT, and the ADC samples are _u16 ("unsigned int").
As part of my troubleshooting, I am collecting 256 samples, and then printing them out to hyperterminal to see what values I get.
I have installed a level shifter at the input of the ADC to bias the incoming audio sample at 1.15V (half of the 3.3V reference on the mBed).
With nothing connected to the MBed terminals (except a level shifter), I get the following numbers in the hyperterminal screen:
32743
32695
4294934568
32743
32583
32743
32743 (...etc)
If I am using the "read_u16" command, the max value is 65535, and half of this max is 32768. The "32,000" values I am getting make sense, but where is the 4294934568 value coming from? Is it a hardware error?
Update: When I use the regular read() function (for a float value from 0 to 1.0), all the values are very consistent with 0.5. It seems that only using the read_u16 command can produce invalid results.