0
\$\begingroup\$

I am using an Arduino Uno as the hardware programmer together with avrdude as the software programmer for flashing an Atmega328.

I have noticed PB0 was set to output the system clock with a logic analyzer. The currently running code was setting PB0 as an input. Double checked with avrdude that the CKOUT bit in lfuse was programmed, so I have changed it like such:

avrdude -P COM20 -b 19200 -c avrisp -p m328p -F -U lfuse:w:0xe2:m

-F is there because this old avrdude that I am using does not know about m328. According to the datasheet the fuses are the same between the P and non-P versions of this MCU.

The low fuse has been verified by avrdude to be written fine, no more clock on PB0 logic analyzer trace, all good. Except that I am no longer able to program the ATmega238. I am stuck at the dreaded avrdude.exe: Device signature = 0x000000

According to the datasheet 0xe2(0b11100010) is:

CKDIV8 - unprogrammed
CKOUT - unprogrammed
SUT1 | SUT0 `10` - Slowly rising power (default) 
CKSEL3 | CKSEL2 | CKSEL1 | CKSEL0 `0010` - 8 MHz inner oscillator (default)

I wonder how I have managed screwing up this time and whether I can unscrew it somehow. Any clues ?


fixed

In short, no idea on what was wrong, but the previous lfuse changing just happened to coincide with the moment it has stopped working.

I have replaced the MCU. Still not working; observed a finicky MOSI line with the logic analyzer, messed around, eventually took out a 47 ohm resistor from the MOSI line and in the process galvanically separated another chip from the same MOSI line.

LE: I have put the 47 ohm resistor back in and it does not fail...

\$\endgroup\$
  • 1
    \$\begingroup\$ To unscrew it, you need a High Voltage Programmer (12V) to erase all the fuses and start over. \$\endgroup\$ – CrossRoads Jan 11 at 16:24
  • \$\begingroup\$ @CrossRoads if only i had such a thing available, I would definitely use it. \$\endgroup\$ – kellogs Jan 11 at 16:28
  • 1
    \$\begingroup\$ Take a read here, maybe you can put one together yourself. Not much is needed. gammon.com.au/forum/?id=12898 \$\endgroup\$ – CrossRoads Jan 11 at 16:57
  • \$\begingroup\$ @CrossRoads Certainly a resource to bookmark! Thanks, but if I get to desolder the chip out of its PCB I'd rather drop a replacement in its place. Nothing important on this particular chip. I was more concerned with what I have done wrong than with the fix. \$\endgroup\$ – kellogs Jan 11 at 17:27
  • 1
    \$\begingroup\$ * Clock settings, I mean. This stuff: "CKSEL3 | CKSEL2 | CKSEL1 | CKSEL0 0010 - 8 MHz inner oscillator (default)" determines if it's using internal vs external oscillator, the expected clock speed, how long to wait for Vcc to rise, etc. BTW, if you've never seen it, take a look at this App Note on Hardware design considerations: microchip.com/wwwAppNotes/AppNotes.aspx?appnote=en591472 \$\endgroup\$ – Kurt E. Clothier Jan 14 at 10:37

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.