Got this 328PB Version and after trying many things i discovered ... you can use the standard Nano Settings - BUT you must use ATmega328P (Old bootloader) as the Programmer and everything is ok 🙂
It's a fact. Using it for a few days now - behaves quite as you would expect from a Nano. Just a little anoying to swich from regular to old Bootloader (using both versions) 🙂 @@WiFiSheep
This saves my day, thanks! I ordered from Mouser wrong chip: Atmega328pb and having problem uploading anything to ICT tracker (for tracking high altitude balloons). Now, I will try to do it again with method you described.
Thanks for this. It was driving me crazy! I ordered 328P and that's what the listing said, but received 328PB and ran into problems as you can imagine. 6 hours later I zoomed in on the chip to see the faint 328PB stamped and not 328P.
The good thing is that the 328PB has much more peripherals compared to the 328P, you've got 5 timers, 2 UARTs... So we can say that we were not scammed, quite the opposite :'D And the other thing is that with my nano board I noticed the TX pin always on when I first plug the board, but I was able to reprogram it by selecting the ATMEGA328P old bootloader... Cheers
I got some of these a couple of days ago and finally got them working fully. Initially using "old bootloader" worked. Various reports said the old bootloader has bugs so I wanted to update it. I tried usbasp but that failed because it said it was the wrong chip signature. I tried adding a 328pb board but the implementation I tried failed with a strange avrdude error message when I tried to write the bootloader. After readiing a few forums I found out you *can* burn the 328p bootloader by changing the chip spec for the 328pb. That can be done by manually entering the bootloader upload commands it uses with avrdude. When you do that the bootloader will lie to the IDE and it will behave pretty much like a normal 328p thereafter. The two chips are apparenly so similar that will work: but you can't use any new features in the 328pb. After finding that solution I found the bug in the other board implementation and now everything works fine.
The most frustrating thing is that these 328PB products are still sold as and even labeled as 328P as you mention. I have two boards with these two chips, I plugged them in both not working, tried a lot of stuff and finally I discovered that 328PB exists... 😂🤣 After that I found your video. Thanks and subscribed, nice job.
It was a Very useful video. Very less people noticed that Arduino UNO and Nano Clone board are available in market using ATmega 328 PB chip-set. This board after programming using ARduino UNO board Selection, it Upload codes. Some Time it Works Properly and Maximum time it works abruptly, Freezes, Restart and many issues. I am a Hobbyist and Academic Project developer and I have many Arduino UNO Board with Atmega328 PB Chipset. Finding for the Solution for this clone board and your this video was helpful for me. Thanks a Lot.
Just for the record maybe someone will find it useful. Some Pro-Mini 3.3v with 328PB they refused to upload code from Serial/FTDI no matter if the bootloader is OK. Try to upload the sketches via programmer, maybe it will work.
WARNING! The ATmega328PB is NOT a drop in replacement for the ATmega328P. TLDNR See Atmel Technical Note AT15007 "Differences between ATmega328P and ATmega328PB" for more information. Of particular concern is that two of the pins that are used for VCC and GND on the ATmega328P are now I/O pins on the ATmega328PB. Pin 3 is GND on the ATmega328P but is PE0/SDA1/ICP4/ACO/PTCXY on the ATmega328PB. While pin 6 is VCC on the ATmega328P but is PE1/SCL1/T4/PTCXY on the ATmega328PB. If the PCB is made as per the original Nano spec for an ATmega328P then pins 3 and 6 will be connected to the GND and VCC rails respectively. If you use an ATmega328PB firmware and enable either of these pins as output things are not going to end well. Pins 19 and 22 have additional functionality on the ATmega328PB but at least these pins are taken out to the ADC6 and ADC7 pins on the Nano. Pin 19 on the ATmega328PB is PE2/ADC6/PTCY/ICP3/SS1 while pin 22 is PE3/ADC7/PTCY/T3/MOSI1. The technical note does, however, state that the ATmega328PB is fully software compatible with the ATmega328P so it "should" be possible to upload a Nano firmware to this device and use it as an ATmega328P without the additional features of the ATmega328PB. This assumes that there are no bugs in the firmware which alter any unused/reserved bits in the ATmega328P registers that are used by the ATmega328PB. Such bugs would go unnoticed on an ATmega328P but may cause issues when executed on an ATmega328PB. This caveat also applies to any libraries used. As others have commented the old Nano bootloader appears to work but the new one does not, this may be the reason why. The Arduino IDE will not program the Nano bootloader into the ATmega328PB because it has a different signature to the ATmega328P and AVRDude checks this signature before uploading anything. It is, however, possible to upload the firmware from the command line using AVRDude with the -F switch. The -F switch (note upper case) forces AVRDude to ignore the signature bytes and upload the firmware. The ATmega328PB also has additional fuse bits and uses a low power oscillator, the rail to rail oscillator option is no longer present. This low power oscillator has a clock failure detection (CFD) circuit and fuse which force the ATmega328PB to revert to an internal 1MHz Calibrated RC Oscillator when it detects missing pulses. This clock failure detection can occur due to poorly routed boards that would not be a problem with a rail to rail oscillator. CFD can only be recovered by power cycling or a hard reset. This can result communication issues and other errant behaviour. caveat emptor
@@bzdzgwa The ATmega328PB is an official part but it is not a drop in replacement for the ATmega328P. Either someone didn't read the Atmel technical note when they chose to use these parts in an Arduino Uno board or they just didn't care. Technically even using an ATmega328P-AU is incorrect for an Arduino Uno as the TQFP-32 part has additional pins not present in the PDIP-28 part which the Uno is designed to use. The ATmega328P-AU is used in the Arduino Nano which has two additional analogue input pins (A6 & A7). There is no way to access these additional pins on a conventional Uno board. Edited to correct part numbers.
@@bzdzgwa As to whether the actual part fitted to any board is genuine or fake is anyone's guess if the board is made in China. My biggest concern is seeing these ATmega328PB parts fitted to printed circuit boards designed to accept the ATmega328P-AU as it means that two of the ATmega328PB's io pins are strapped directly to the power lines provided for the ATmega328P-AU; one to ground and one to power. I've seen the ATmega328PB fitted to standard nano boards and even Uno "compatible" boards that have this problem.
I have the same problem with the Chinese Ardunio NANO that comes with the MEGA328PU - TH chip. I can't write the bootloader to it, in the IDE this message comes: avrdude: Expected signature for ATmega328P is 1E 95 0F Double check chip, or use -F to override this check. Does anyone know how to use -F to override this check or solve this problem?
What you have is an ATmega328P-AU. Microchip (who bought Atmel) changed the way they marked these chips a while ago. The chip will be marked as follows: Atmel MEGA328P U-TH xxxxxxx yywwbbb Line 1 is the Atmel logo. line 2 is the device id (ATmega328P). Line 3 is the packaging and country of manufacture. This is the biggest change as Microchip stopped putting the package type here (A=tqfp, P=pdip) as you know if it's a pdip or tqfp since you are looking at it. The TH means it was made in Thailand. I've also seen U-KR which are made in Korea. The U means that the package is lead (Pb) free. Line 4 is the die revision number. Line 5 is the year (yy) and week number (ww) it was manufactured and the batch/lot number (bbb). It's confusing because the part number used for ordering (ATmega328P-AU) is not what is written on the chip. Having explained all of that, if the part is a genuine ATmega328P it should have the signature bytes 1E 95 0F. You have not stated what avrdude thinks it is. So either: 1. You have not connected your programmer correctly and it is reading garbage. 2. You have a counterfeit/fake part. 3. The chip is defective. If you are getting 1E 95 16 as the signature bytes then you have an ATmega328PB-AU that has been marked as ATmega328P-AU. Which means it's a fake and possibly contains a defective die. To use the -F switch with avrdude you must run avrdude from the command line, not from the Arduino IDE, consult the avrdude documentation for more information.
Did you have to figure all this out yourself? It strikes me as strange that anyone could make a product this incompatible with no instructions about how to use it.
I cant take credit for everything, and trust me I did a lot of hours of trying to figure this out. I honestly didn't even know 328pb was a thing until this happened. And the products are still sold as and even labelled as 328p. So theres no additional documentation at all! But as ive figured this out, it was important to share with the community, as so many are going to hit this issue going forward.
I have just tested the links and library again on a fresh IDE install on another machine and have had no issue... So im not sure what the issue is here?
@@WiFiSheep Yeah I looked at it from close up it's a 328PB, looks like the bootloader is successfully installed but I cannot for the life of me upload any code to it.
Make sure your on the correct COMs port for the device, that the 328PB library is installed and running as shown in the video... Make sure you have the CH340 drivers installed if your on PC or MAC sparks.gogo.co.nz/ch340.html If still issues You might want to try refreshing the boot loader. Just to be sure... you're not trying to use external HEX uploads like Xloader? As these dont work with 328PBs
Thats an interesting one! I assume you can use other Arduino ok and the IDE is working? Might be permissions issues, if the IDE is getting blocked... failing that chip or board issue ... might be work hopping on the Arduino Forums
Finally! thank you very much. With your help I solved the bootloader problem
Glad I could help
Got this 328PB Version and after trying many things i discovered ... you can use the standard Nano Settings - BUT you must use ATmega328P (Old bootloader) as the Programmer and everything is ok 🙂
Oh how interesting... is that a fact? Well thanks for the info!
It's a fact. Using it for a few days now - behaves quite as you would expect from a Nano. Just a little anoying to swich from regular to old Bootloader (using both versions) 🙂 @@WiFiSheep
If i get a chance, I am going to try this :-) Huge thank you once again for the tip off!
I've had permission issues with Arduino boards and Linux, a simple chmod tends to solve it.
This saves my day, thanks! I ordered from Mouser wrong chip: Atmega328pb and having problem uploading anything to ICT tracker (for tracking high altitude balloons). Now, I will try to do it again with method you described.
Thanks for this. It was driving me crazy! I ordered 328P and that's what the listing said, but received 328PB and ran into problems as you can imagine. 6 hours later I zoomed in on the chip to see the faint 328PB stamped and not 328P.
Glad I could help! Totally understand the frustration! Hence this video to help out fellow makers. Hope you've all sorted now?
The good thing is that the 328PB has much more peripherals compared to the 328P, you've got 5 timers, 2 UARTs... So we can say that we were not scammed, quite the opposite :'D
And the other thing is that with my nano board I noticed the TX pin always on when I first plug the board, but I was able to reprogram it by selecting the ATMEGA328P old bootloader... Cheers
I got some of these a couple of days ago and finally got them working fully. Initially using "old bootloader" worked. Various reports said the old bootloader has bugs so I wanted to update it.
I tried usbasp but that failed because it said it was the wrong chip signature.
I tried adding a 328pb board but the implementation I tried failed with a strange avrdude error message when I tried to write the bootloader.
After readiing a few forums I found out you *can* burn the 328p bootloader by changing the chip spec for the 328pb. That can be done by manually entering the bootloader upload commands it uses with avrdude. When you do that the bootloader will lie to the IDE and it will behave pretty much like a normal 328p thereafter. The two chips are apparenly so similar that will work: but you can't use any new features in the 328pb.
After finding that solution I found the bug in the other board implementation and now everything works fine.
Interesting! First off well done and Second, thanks for sharing your findings! Really useful to feed back into the community :-) - Tom
The most frustrating thing is that these 328PB products are still sold as and even labeled as 328P as you mention. I have two boards with these two chips, I plugged them in both not working, tried a lot of stuff and finally I discovered that 328PB exists... 😂🤣 After that I found your video.
Thanks and subscribed, nice job.
It was a Very useful video. Very less people noticed that Arduino UNO and Nano Clone board are available in market using ATmega 328 PB chip-set. This board after programming using ARduino UNO board Selection, it Upload codes. Some Time it Works Properly and Maximum time it works abruptly, Freezes, Restart and many issues.
I am a Hobbyist and Academic Project developer and I have many Arduino UNO Board with Atmega328 PB Chipset. Finding for the Solution for this clone board and your this video was helpful for me.
Thanks a Lot.
Just for the record maybe someone will find it useful.
Some Pro-Mini 3.3v with 328PB they refused to upload code from Serial/FTDI no matter if the bootloader is OK. Try to upload the sketches via programmer, maybe it will work.
WARNING! The ATmega328PB is NOT a drop in replacement for the ATmega328P.
TLDNR
See Atmel Technical Note AT15007 "Differences between ATmega328P and ATmega328PB" for more information. Of particular concern is that two of the pins that are used for VCC and GND on the ATmega328P are now I/O pins on the ATmega328PB. Pin 3 is GND on the ATmega328P but is PE0/SDA1/ICP4/ACO/PTCXY on the ATmega328PB. While pin 6 is VCC on the ATmega328P but is PE1/SCL1/T4/PTCXY on the ATmega328PB. If the PCB is made as per the original Nano spec for an ATmega328P then pins 3 and 6 will be connected to the GND and VCC rails respectively. If you use an ATmega328PB firmware and enable either of these pins as output things are not going to end well.
Pins 19 and 22 have additional functionality on the ATmega328PB but at least these pins are taken out to the ADC6 and ADC7 pins on the Nano. Pin 19 on the ATmega328PB is PE2/ADC6/PTCY/ICP3/SS1 while pin 22 is PE3/ADC7/PTCY/T3/MOSI1.
The technical note does, however, state that the ATmega328PB is fully software compatible with the ATmega328P so it "should" be possible to upload a Nano firmware to this device and use it as an ATmega328P without the additional features of the ATmega328PB. This assumes that there are no bugs in the firmware which alter any unused/reserved bits in the ATmega328P registers that are used by the ATmega328PB. Such bugs would go unnoticed on an ATmega328P but may cause issues when executed on an ATmega328PB. This caveat also applies to any libraries used. As others have commented the old Nano bootloader appears to work but the new one does not, this may be the reason why.
The Arduino IDE will not program the Nano bootloader into the ATmega328PB because it has a different signature to the ATmega328P and AVRDude checks this signature before uploading anything. It is, however, possible to upload the firmware from the command line using AVRDude with the -F switch. The -F switch (note upper case) forces AVRDude to ignore the signature bytes and upload the firmware.
The ATmega328PB also has additional fuse bits and uses a low power oscillator, the rail to rail oscillator option is no longer present. This low power oscillator has a clock failure detection (CFD) circuit and fuse which force the ATmega328PB to revert to an internal 1MHz Calibrated RC Oscillator when it detects missing pulses. This clock failure detection can occur due to poorly routed boards that would not be a problem with a rail to rail oscillator. CFD can only be recovered by power cycling or a hard reset. This can result communication issues and other errant behaviour.
caveat emptor
Are these 328PBs that are sold in China real Microchip products, or are counterfeit clones?
@@bzdzgwa The ATmega328PB is an official part but it is not a drop in replacement for the ATmega328P. Either someone didn't read the Atmel technical note when they chose to use these parts in an Arduino Uno board or they just didn't care. Technically even using an ATmega328P-AU is incorrect for an Arduino Uno as the TQFP-32 part has additional pins not present in the PDIP-28 part which the Uno is designed to use. The ATmega328P-AU is used in the Arduino Nano which has two additional analogue input pins (A6 & A7). There is no way to access these additional pins on a conventional Uno board.
Edited to correct part numbers.
@@bzdzgwa As to whether the actual part fitted to any board is genuine or fake is anyone's guess if the board is made in China. My biggest concern is seeing these ATmega328PB parts fitted to printed circuit boards designed to accept the ATmega328P-AU as it means that two of the ATmega328PB's io pins are strapped directly to the power lines provided for the ATmega328P-AU; one to ground and one to power. I've seen the ATmega328PB fitted to standard nano boards and even Uno "compatible" boards that have this problem.
Thanks for the video, you saved three Arduinos from going to trash :)
Glad I could help! I had 30+ of the things for a commercial project so trash wasn't an option :-/
I have the same problem with the Chinese Ardunio NANO that comes with the MEGA328PU - TH chip. I can't write the bootloader to it, in the IDE this message comes: avrdude: Expected signature for ATmega328P is 1E 95 0F Double check chip, or use -F to override this check. Does anyone know how to use -F to override this check or solve this problem?
What you have is an ATmega328P-AU. Microchip (who bought Atmel) changed the way they marked these chips a while ago. The chip will be marked as follows:
Atmel
MEGA328P
U-TH
xxxxxxx
yywwbbb
Line 1 is the Atmel logo. line 2 is the device id (ATmega328P). Line 3 is the packaging and country of manufacture. This is the biggest change as Microchip stopped putting the package type here (A=tqfp, P=pdip) as you know if it's a pdip or tqfp since you are looking at it. The TH means it was made in Thailand. I've also seen U-KR which are made in Korea. The U means that the package is lead (Pb) free. Line 4 is the die revision number. Line 5 is the year (yy) and week number (ww) it was manufactured and the batch/lot number (bbb). It's confusing because the part number used for ordering (ATmega328P-AU) is not what is written on the chip.
Having explained all of that, if the part is a genuine ATmega328P it should have the signature bytes 1E 95 0F. You have not stated what avrdude thinks it is. So either:
1. You have not connected your programmer correctly and it is reading garbage.
2. You have a counterfeit/fake part.
3. The chip is defective.
If you are getting 1E 95 16 as the signature bytes then you have an ATmega328PB-AU that has been marked as ATmega328P-AU. Which means it's a fake and possibly contains a defective die. To use the -F switch with avrdude you must run avrdude from the command line, not from the Arduino IDE, consult the avrdude documentation for more information.
Serial monitor changes if touching the pins.
Thankyou for the video...... It helped me a lot
Glad to hear that... I knew when i went though this issue I had to make this video as it would be helpful to so many people!
Can I do this with just an Arduino uno 328pb???
Yes the Nano and Uno share the same chip so the process should be identical.
Did you have to figure all this out yourself?
It strikes me as strange that anyone could make a product this incompatible with no instructions about how to use it.
I cant take credit for everything, and trust me I did a lot of hours of trying to figure this out. I honestly didn't even know 328pb was a thing until this happened. And the products are still sold as and even labelled as 328p. So theres no additional documentation at all!
But as ive figured this out, it was important to share with the community, as so many are going to hit this issue going forward.
thankyou sir
I tried to find the library and it is gone.😢
I have just tested the links and library again on a fresh IDE install on another machine and have had no issue... So im not sure what the issue is here?
I've done everything I can think of with an Arduino Uno with 328PB but no luck any tips?
If its an Uno are you sure its a 238PB? and not a 238PU?
@@WiFiSheep Yeah I looked at it from close up it's a 328PB, looks like the bootloader is successfully installed but I cannot for the life of me upload any code to it.
Make sure your on the correct COMs port for the device, that the 328PB library is installed and running as shown in the video...
Make sure you have the CH340 drivers installed if your on PC or MAC
sparks.gogo.co.nz/ch340.html
If still issues You might want to try refreshing the boot loader.
Just to be sure... you're not trying to use external HEX uploads like Xloader? As these dont work with 328PBs
@@WiFiSheep checked the port, have the library installed, have the drivers intaller, have a fresh bootloader installed, no external uploads either.
Thats an interesting one! I assume you can use other Arduino ok and the IDE is working? Might be permissions issues, if the IDE is getting blocked... failing that chip or board issue ... might be work hopping on the Arduino Forums