I'm having problems with a Duemilanove that I just purchased. I'm trying to get the analog pins to read a simple input voltage using a potentiometer (really simple stuff). The problem is that no matter which analog pin I configure as the input pin, the input value is always showing 1023.
I have tested out the sketch and the potentiometer on a 2nd Duemilanove board that I have and it works fine.
I swapped the ATMega 328 chip between my 2 Duemilanove boards and the problem clearly follows with the board (not the 328).
I've tested the continuity between the 6 analog in pins and pins 23 - 28 on the 328 and it's ok.
Does anyone have any ideas on what might be causing such a problem? The board looks ok but there certainly appears to be a hardware problem of some sort that's disabling the analog in pins of the ATMega 328.
Could you also test the analog-ref pin on the problematic board? It's next to a gnd pin.If they short then your reference voltage is essentially zero so any input is max (1023). Where did you get your board?
This sounds quite unlikely. There is nothing between the connectors and the chip pins. So you say when you connect ground, you do not read 0 but 1023?? Can you please check this with a wire to ground rather than with the pot set-up?
However... The ADC reading is influenced by what is going on at the Aref pin. Note: There must be no input to the Aref (other than a capacitor of some ten nF to ground). Can you check that also? Is there a difference in the voltage reading between your two boards?
Or is there an issue at the Vadc pin? Can you measure that voltage directly at the chip?
Thanks for teh quick reply liudr.
I'll check out the analog-ref pin when I get home from work tonight. It sounds like it may be a possability though.
I bought the board off Ebay from a seller in China (I'm in Australia).
Thanks
Matt
I've purchased from R-Cube as well (not this Duemilanove board though). and agree that they provide a good service. Perhaps I should have stuck with them.
OK! I tested the connection between ARef and ground and indeed there was a short circuit. I took a look under a magnifying glass and found that solder had leaked between the ARef and GND pins. I cut the solder leak with an exacto knife and voila! Problem fixed. So much for QC.
Many thanks indeed to those who helped me out. You saved me having to ship the board back to China.
So like I suspected, that ADC WAS telling you the truth! ;D ;D ;D
Could you PM me which ebay member you bought if from? I'm in the market for some cheaper aduino boards. Could avoid them if I know who they are.