Bricked Atmega168

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey Guys,

I have read over Cliff's thread...mostly and have tried to unbrick my LCD Backpack. Massive pain in the bug being surface mount im trying to hold everything in place with one hand and trying to open the application with the other :|

First up, I am trying to reprogram the backup as it has to share a serial port with a debugger and as such, I don't want all the debugging information to come up on the LCD because, well, there is A LOT. So I am making it command specific.

Pushing on: I programmed it the first few times with avr dude then made the mistake of clicking the yes to the fuse error question and that I "would like to go back to default fuse settings" or something along those lines. Since, the AVR is showing in avrdude as invalid device ID 0x00000.

I have used my arduino to make a 1.6MHz clock signal (as said on the oscilloscope) by bit-banging PortB like Cliff said in his post. I then proceeded to hold a wire touching the surface mount pin XTAL1 (buiiggest pain ever) while leaving the XTAL2 pin not connected and grounded the arduino and LCD backpack together. then plugged in the ISP connector and tried the command:

avrdude -c usbasp -p atmega168 -U flash:w:"LCD_BackPack\Debug\LCD_BackPack.hex" -F

Same deal, same result! So I tried to set the fuses instead, no deal either.

As I just found out that it PREVIOUSLY had the arduino bootloader and I should've just used that, maybe next time.

I am pretty open at this stage to any ideas to try something else?

Backpack Schematic

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When you provided the clock to XTAL1 were the Gnd's also connected? Obviously the generated clock signal is with respect to ground and if that ground is not connected it won't work.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I grounded the Bricked chip with the ground of the Arduino that acted as the External Clock.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what is your programming speed?
you have a clock of 1.6MHz you need to divide that by 8 (it might be that the clkdiv8 fuse is set) and then again by 4 (as programming speed may be max 1/4 of clock speed) so your maximum programming frequency is to be 1,6MHz/32 = 50KHz.

first you need to get the signature again, before you get a valid signature there is no need in trying anything else....

edit:
and to start solder the wires instead of holding them. This will make sure the connection is good, that saves a variable...)
miso/mosi exchanged by acident????

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Follow meslomp's advice. Solder some tiny wires to XTAL1 pin, MISO, MOSI, SCK ...

Never use -F in an avrdude command.

In hindsight, you could have re-programmed quite easily. e.g. bootloader or SPI.
Think about it. The maker had to program the firmware in the first place! You probably have access to UART pins for bootloader, or SPI pins for ISP. The pads may not be together in a header, but I bet the maker used a pogo-pin arrangement to make contact with each necessary signal.

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I originally held it and got a second opinion from a mate. He suggested exactly what you said above. We used the AVR mkII (something) programmer made from atmel and attempted to do it through atmel studio itself. First providing a 125KHZ external clock (thanks to delays in-built into arduino's from the overhead) and ranged the programmer from 3.xxxKHz to 250KHz for vairous goes. No avail. Attached is what I soldered on and what changed in the second go. Atmel Studio kept saying that it had no signature "----". Tried the programmer with atmega168 on the arduino, worked fine.

I think it might be time to disconnect the backpack from the LCD and try HVPP with the dragon :(

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Try connecting trough debug wire first.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the backpack functioning ok?
i.e. do you just want to change the existing working firmware?

It will be very difficult to unsolder your backpack. I would use sidecutters to cut though the header pins that join the two boards. Somewhat easier to remove the mega168.
Then replace it with a new mega168.

When you use -F or reply to avrdude's fuse question, you stand a very high risk of setting wrong clock fuses, RSTDIBL, DWEN, ...

Only RSTDISBL is fatal.

Since you have supplied an external clock and you have a Dragon, try debugWIRE first.

David.