04 April 2024

Fault on Atmel AVR ATmega


For the blinkenlights project two posts behind I chose to use an ATmega48 because the firmware is very small, while all my other (clock) projects would not fit. I noticed that it was not scanning all neon lamps and that the current consumption was periodically jumping about +100mA.

I determined that the problem was in the ATmega48 and probed all output pins with an analog voltmeter, looking for a swing that matched the current variations.

I found an output pin reaching +3.5V in the HIGH state, and it was in sync with the extra current draw. That digital pin measured 64 ohm to ground even with the uC out of the circuit. Culprit located.

I cut off the pin with broken control circuitry and used a different one with a simple jumper on the PCB. It's just a matter of updating the firmware.

Problem solved: no more I variations and all lamps light up as expected.

Why did I use an analog voltmeter? Because I could visually see the voltage change and estimate its value. A DVM would take too long to detect the change and I would not be able to correlate it to the current flow. I could have used an oscilloscope, of course.