Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Weird values on ADC channel 4

2007-09-08 by Gustavo Goretkin

Hi,
 I'm running some code on an ATMega32 (PDIP, 16mHz) I'm using 4 of the 8 
ADC channels to collect data from sensors (gyros and accelerometers). 
These are channels 1,2,3,4 (channels from 0-7). I am, in reality, using 
only channel 1,3,4 (plan to add a sensor connected to 2 soon). Channels 
1 and 3 receive very accurate data, but for some reason channel 4's data 
is always off. For example, I'm using a two-axis accel. connected to 
channels 3 and 4. After I average 3 and 4's values for a while to get 
the bias of the accelerometer's outputs, 3 always returns a value of 
zero (after removing the bias and having the sensor still), but 4 always 
returns some random value that is anywhere from 15-30 ADC units off. I 
have switched the sensor configuration (swapped 3 and 4), and still 4 
returns non-ideal values and 3 is fine. I have read of problems on the 
ATMega 128 with JTAG on the first four pins of Port A, but Port A's 
alternate function on the ATMega 32 is ADC only. Is there something I am 
missing?

Thanks.
Gustavo Goretkin

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.