0
\$\begingroup\$

I am fairly new to embedded programming. I bought some Atmega328P U chips (not Atmega328P-PU). I have two Arduino boards and the chips worked just fine, and were letting me upload sketches. One of those chips stopped working while trying to upload bootloader using one Uno board to other.

I bought a usbasp programmer like this one - (https://www.fischl.de/usbasp/bilder/usbasp_kit.jpg) which has two jumpers (it is set to J2). I used ProgISP software from Zhifengsoft, which successfully read my chips. But after clicking 'ERASE', the Atmega chips did read for a few times and then stopped responding at all. Now, everytime I click read (RD) on the software, it says CHIP ENABLE PROGRAM ERROR. However, it successfully reads an Atmega8A chip I have, which suggests something is wrong with only my Atmega328P chips. I do remember the setting 'PROGRAM FUSE' was enabled at time of erase.

  1. What has gone wrong with them?
  2. Is there a way to recover them or they are just useless now since software cannot read them anymore?
  3. Do I need some other programmer and technique to use that I am not aware of?

[UPDATE] I tried using Arduino IDE and Khazama AVR programmer software which give the same error for my Atmega328P chips - "target doesn't answer. initialization failed rc=-1. Flashw riting fail. However, as usual, Atmega8A chip programs just fine.

\$\endgroup\$
0
\$\begingroup\$

Most likely you programmed the fuse bits into such values that the chip does not work any more in the current hardware as it might expect different clock hardware now. Don't program the fuses unless you thoroughly understand their operation.

Depending on what the new fuse settings were, it might be recovered by giving it external clock in place of crystal. If the ISP disable fuse is set, it can't be programmed via ISP any more, and you need a parallel programmer, so it might be cheaper to just get a new MCU instead.

\$\endgroup\$
7
  • \$\begingroup\$ Hello. Thank you for answering Justme. I was just reading about something known as HVPP/HVSP. Is that what you meant when you said parallel programmer? I would like to purchase one so that I can recover my bricked chips in future. Can you please recommend me some good ones in starting price range? \$\endgroup\$ – J J Dec 15 '19 at 10:53
  • \$\begingroup\$ [UPDATE] I tried using Arduino IDE and Khazama AVR programmer software which give the same error for my Atmega328P chips - "target doesn't answer. initialization failed rc=-1. Flashw riting fail. However, as usual, Atmega8A chip programs just fine. \$\endgroup\$ – J J Dec 15 '19 at 10:55
  • \$\begingroup\$ Yes, HVPP is short for High Voltage Parallel Programming, but first try normal ISP with external clock. No, I can't give suggestions what to buy as asking for suggestions what to buy is against the rules. But you could perhaps turn the working Arduino into a HVPP programmer so you don't have to buy one. \$\endgroup\$ – Justme Dec 15 '19 at 11:00
  • \$\begingroup\$ Thanks for letting me know this useful information. I will need to buy another atmega328P chip to have a working Arduino as all of them have stopped responding so far. I will Google for how to convert an Arduino into an HVPP. By external clock, do you mean an external crystal oscillator? I do have a 16 MHz crystal and I was just trying to use it since your last comment, re-started my programmer etc but it does not help so far. Anything else I might try before going to buy new chips/parallel programmer? \$\endgroup\$ – J J Dec 15 '19 at 11:03
  • \$\begingroup\$ Also, as I wrote in my post, I am using USPASP programmer. And my external crystal is linked to the target chip with two 22pf non-electrolytic capacitors, and not with the usbasp programmer. I hope that is correct. \$\endgroup\$ – J J Dec 15 '19 at 11:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.