Re: [AVR-Chat] Weird values on ADC channel 4
2007-09-08 by Jim Wagner
On Sat, 08 Sep 2007 03:11:18 -0400 Gustavo Goretkin <gustavo@goretkin.com> wrote: > 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 Is the axis with steady signal the Z axis, perhaps? If it is, you are just measuring gravity? Jim --------------------------------------------------------------- The Think Different Store http://www.thinkdifferentstore.com/ For All Your Mac Gear ---------------------------------------------------------------