ATMega328 on a breadboard - partially fried?

Hi,

my ATMega328 DIP-28 µC was bricked some time ago when I burned a bootloader with faulty wires. I "revived" it with "HVRescue Simple". After that I could upload sketches and burn bootloader via ArduinoISP. However, I constantly get a verification error, e.g.

Sketch upload:
verification error, first mismatch at byte 0x0107
         0x60 != 0xe0

Burn bootloader:				 
verification error, first mismatch at byte 0x781d
         0x14 != 0x94

Once I managed to burn a bootloader and blink sketch without verification error. Before bricking it, I was able to burn bootloader and upload sketches without any problems.

I did try different cpu speeds and bootloaders, respectively, without success.
Any chance I can cure the µC?

Thanks & best

I added two capacitors to GND/VCC and the verification error went away.
However, serial output is messed up:

sY▒▒ge▒Y▒k▒AD(z▒▒
1▒Q/PW▒▒▒▒/7▒p]▒▒▒: n▒▒▒▒QA/P▒▒▒▒/▒L▒pul▒]▒ no▒▒&▒▒TA   u%▒▒ 3▒KL▒pu▒▒▒ yesC▒▒▒iva▒Y▒Q▒TE_(*9E I▒▒▒▒upt▒ wZ

(some character are correct, e.g. pu…=pullup, “yes”, “no”
In general, the ATMega328 DIP28 version should be able to communicate via TX/RX, right? I remember that I never was able to upload sketches via TX/RX but only via SPI.

Best

Once I managed to burn a bootloader and blink sketch without verification error. Before bricking it, I was able to burn bootloader and upload sketches without any problems.

In general, the ATMega328 DIP28 version should be able to communicate via TX/RX, right? I remember that I never was able to upload sketches via TX/RX but only via SPI.

Uploading by a bootloader is loading via serial connection. Then you say you cannot upload via serial. So which case is true? It cannot be both.

(some character are correct, e.g. pu..=pullup, "yes", "no"

My first response is "and your point is?". Most of the characters are wrong. You'll need to explain this further.

In general, the ATMega328 DIP28 version should be able to communicate via TX/RX, right?

Yes, but it requires a bootloader to do that.

Your post contains very little useful information and one big contradiction. It sounds like you're dealing with a bare chip on a breadboard. But I could be wrong. Your atMega328 might be toast, it's never good to receive a verification error. But, I could be wrong.

Thanks for your reply. I'm sorry, that I failed to provide useful information. 
[quote author=avr_fred date=1498601763 link=msg=3317686]Then you say you cannot upload via serial. So which case is true? It cannot be both.

Maybe I have a major misunderstanding how things work.

I'm using a DIP-28 ATMega328P which resides in a DIP-28 socket soldered to a PCB.
My setup is like this, just added two caps (source):

In this configuration I burned the bootloader and I upload the sketch, respectively.
In comparison to this picture:

I'm not using TX/RX to upload the sketch.

Now clear what I meant?

avr_fred:
My first response is "and your point is?". Most of the characters are wrong. You'll need to explain this further.

I just wanted to clarify that the output is no random garbage but actual text the sketch produces with massively scrambled characters.
Got the point?

avr_fred:
Your post contains very little useful information and one big contradiction.

Is there more information now and could I solve the contradiction?

Thanks & Best.

avr_fred:
Yes, but it requires a bootloader to do that.

False. Uploading programs through serial requires the bootloader. Simply sending and receiving Serial communications in the sketch does not.

terraduino, have you added a crystal to your board? Or did you flash a custom bootloader that uses the internal oscillator?

The internal oscillator isn't accurate enough for serial communication to work reliably. That's why even the 8mhz arduinos have a crystal on them. Internal oscillator is only spec'ed to within 10%, while you need like 2% for serial to work; the internal oscillator speed varies with temperature, voltage, and between individual parts - so some chips will be close enough to 8mhz at 5v and room temperature for serial to work, and others won't.

Thank you both for your feedback. :slight_smile:

Jiggy-Ninja:
terraduino, have you added a crystal to your board? Or did you flash a custom bootloader that uses the internal oscillator?

No, I’m using the internal oscillator. I’ve used the MiniCore Bootloader (ATMega328, 8 MHz internal oscillator) and fuse-settings, respectively. I’ve also tried the “ATMega328 on a breadboard” bootloader.

DrAzzy:
The internal oscillator isn’t accurate enough for serial communication to work reliably.

Well, that sounds plausible. However, I’ve a bunch of Pro Mini clones ripped of their voltage regulator and fused to use the internal oscillator. Serial communication has been reliable with them for month. Temperature between 15-25 degrees Celsius, 3.3-5 Volt powersupply.
Maybe the DIP version has an internal oscillator that is much worse than their TQFP32 counterparts? But as you explained, looks like I’ve been very lucky with my ProMini clones.
Btw. I won’t get myself an ATMega DIP again - not worth it.

sigh I’m still not used to the subtle influences on µC behavior. Therefore, I’m glad both of you took the time to help me!

Thanks & best

terraduino:
Maybe the DIP version has an internal oscillator that is much worse than their TQFP32 counterparts? But as you explained, looks like I've been very lucky with my ProMini clones.
Btw. I won't get myself an ATMega DIP again - not worth it.

Unlikely. I'd bet good money that the die is exactly the same no matter what package it's in. It's cheaper that way. It's probably just luck.

I did a project a few years ago that tried to use the watchdog timer (which has similar tolerance to the 8 mHz oscillator) to synchronize transmission between two ATtiny84s so that they could sleep in between and save power. The transmission happened every 2.5 seconds and the receiver was timed to wake up a few milliseconds before the transmitter to ensure it received the signal.

Unfortunately that's not good enough. We made 3 pairs of devices, and only one worked as intended. On pair occasionally had the receiver wake up too late, and in the last pair the receiver always woke up too late and missed that transmitted packet. The transmitter's watchdog timer was running faster than the receivers's. When we swapped the chips in the pair so that the faster chip was the receiver, it worked perfectly.

RC oscillators are not meant for high accuracy. You won't notice the difference if it's just blinking LEDs and timing stuff for you, but when you need to keep things synchronized between independent controllers, they're very poor.

@Jiggy-Ninja
Thanks for the advice. Will remember it.

Best