Go Down

Topic: ATMEGA328P U incompatible? (Read 5386 times) previous topic - next topic

line_code

Aug 05, 2018, 10:35 pm Last Edit: Aug 05, 2018, 10:38 pm by line_code
Hello everyone!

I've ran into a bit of a strange problem.  I am using ATMEGA328 chips as the microcontroller for a circuit board I designed.  I am using the ATMEGA328P-PU version like the uno uses.  I have purchased chips from both Mouser and Digikey and I've found that the ones I get from Mouser are labeled ATMEGA328P U and the ones from Digikey are labeled ATMEGA328P-PU like the ones in the uno.  I verified that I did indeed buy ATMEGA328P-PU from both suppliers.  I don't exactly care about the labeling, but I've noticed that the ATEMEGA328P U version doesn't function quite like it should after a little while of use until you start over by cycling the power.  What is the difference between ATMEGA328P U and ATMEGA328P-PU?  Why don't the two versions operate the same?  Is it possible to get them to operate the same?

I've attached pictures of the two versions for your reference.

Please let me know if you can help me.

pert

line_code's pictures:



This is very strange because I've never seen an official mention of the "ATmega328P-U"

I have seen this topic on the forum before:

and on avrfreaks:
https://www.avrfreaks.net/forum/atmega328-chip-markings-initial-program-memory-and-flags-state-ids
But nowhere do I see a good conclusion on what the story is with this chip. I don't even see a listing on Mouser for the ATmega32P-U. I would contact Mouser customer service and ask them if they know why their chips are marked in a non-standard way.

I've noticed that the ATEMEGA328P U version doesn't function quite like it should
Please explain exactly what you mean by "doesn't function quite like it should".

line_code

Please explain exactly what you mean by "doesn't function quite like it should".
I am using a modified version of the code on this topic.  Its been modified to monitor some of the actual bits in the data stream and output them to some 74HC595's for external processing and analysis.  For whatever odd reason, the code works fine at first, but then after some random length of time(at the least probably 3 minutes and at the most maybe 10), the board will stop monitoring a random bit in the stream and turn off the respective output on the 595 until power is cycled.  I don't think that this anomaly occurs EVERY time, but it does happen probably 98% of the time.

Not sure if it matters, but I'm obviously writing the code in the Arduino IDE, but I am putting the code directly on the chip without the bootloader using a TL866CS.

The fuses I use are:

LOW: FF
HIGH: DE
EXTENDED: FD
LOCK: FF or FC depending on whether I want the code locked or not.

DrAzzy

Are the chips properly decoupled? Process differences between individual chips/lots can render them more or less sensitive to improper or insufficient decoupling caps.

The P U chips are more recently produced, if I'm interpreting the date codes right. Maybe they got a die shrink or something?
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

line_code

Are the chips properly decoupled? Process differences between individual chips/lots can render them more or less sensitive to improper or insufficient decoupling caps.

The P U chips are more recently produced, if I'm interpreting the date codes right. Maybe they got a die shrink or something?
It seems I have forgotten a decoupling cap for the ATMEGA, but my other logic chips have them.  I have an abundance of 1uf 50V electrolytics.  Would those work?  Could I solder one of those to the bottom side of the board to the chip's socket?  If yes, which set of power pins should I use or should I use one pin from each?

pert

You need 0.1 uF capacitor on each. You could try the 1 uF and it might work. Decoupling capacitors are a ballpark sort of thing. Your circuit board will act as a capacitor by itself. Some people even manage to get by without any at decoupling caps all but it's certainly not a good idea. Really you should just have a stock of 0.1 uF capacitors because they are always useful.

DrAzzy

#6
Aug 08, 2018, 03:40 am Last Edit: Aug 08, 2018, 03:42 am by DrAzzy
Electrolytic caps suck for decoupling. They have too much ESL and ESR. Ceramics are what you want (tants are ok too, but they cost several times as much and explode if you connect them backwards - I only use them in special situations, not run of the mill decoupling ). Buy a bag, you'll use more 0.1uF ceramic caps than any other single part.
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

line_code

Electrolytic caps suck for decoupling. They have too much ESL and ESR. Ceramics are what you want (tants are ok too, but they cost several times as much and explode if you connect them backwards - I only use them in special situations, not run of the mill decoupling ). Buy a bag, you'll use more 0.1uF ceramic caps than any other single part.
Ok, so I buy a bunch of .1uF ceramic caps.  Then what?  Until I order a new revision board, I'm going to need to connect them to the board I have.  Should I solder one to the bottom of the board to one set of the Atmega's power pins?  On pin from each set of power pins?  Two capacitors total, one for each set of power pins?

DrAzzy

One on each side. And make sure that AVcc and Vcc are connected (I have seen tutorials where this isn't done).
ATTinyCore for x4/x5/x61/x7/x8/x41/1634/828/x313 megaTinyCore for the megaavr ATtinies - Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts, mosfets, awesome prototyping board in my store http://tindie.com/stores/DrAzzy

line_code

One on each side. And make sure that AVcc and Vcc are connected (I have seen tutorials where this isn't done).
Luckily it looks like I already did that.

I finally got some 0.1 uf ceramic capacitors.  Pretty soon I'll be testing the board with and without them to conclusively decide whether or not they fix the problem.

EmSerg

#10
Aug 16, 2018, 01:46 pm Last Edit: Aug 16, 2018, 04:24 pm by EmSerg
Hi,
in IDE errors!
use https://github.com/MCUdude/MiniCore
all working !!! (Recommend turn on WDT & BOD for Vcc.)

line_code

The added caps didn't help.  I think I might try to contact Mouser and Atmel/Microchip to see what's up.

pert

Please let us know what they say about the ATmega328P-U marking.

line_code

#13
Sep 25, 2018, 06:32 pm Last Edit: Sep 25, 2018, 06:35 pm by line_code
I've tried emailing Mouser, but they didn't respond.  I was really wanting to email Atmel/Microchip, but I can't find a way to do that on their website.  Anyone know how I might be able to do that?

Also, Digikey is now selling the ATMEGA328P U chip instead of the ATMEGA328P-PU, but it looks different from the ATMEGA328P U I received from Mouser a while back.  (See photo).  The text on the chip looks almost printed instead of engraved and those little impressed circle things are bigger on the ones I just got from Digikey.  I haven't got a chance to test the new ones from Digikey yet, but I'm hoping they work like the ATMEGA328P-PU I used to be able to get.


Go Up