Go Down

Topic: How to use 328PB as a Arduino uno? (Read 1 time) previous topic - next topic

Zumii_Z

Oct 11, 2018, 11:39 am Last Edit: Oct 11, 2018, 11:41 am by Zumii_Z
Hi everyone,

I have some problem to get my 328PB-mu working on my project.

I bought some QFN type of 328PB-MU chips from Alibaba and I have followed the following steps: https://github.com/watterott/ATmega328PB-Testing ;

To be more specific, after I have installed package_m328pb_index.json onto my Arduino IDE and chose the selections below to burn the bootloader.  It went smoothly as I expected.
https://imgur.com/0extCt8
https://imgur.com/GCMNzcJ


Then, I have tried to upload my sketch to my project board like this but it responded nothing.......

https://imgur.com/lHGElKz
avrdude.exe: stk500_getsync() attempt 8 of 10: not in sync: resp=0x88
avrdude.exe: ser_send(): write error: sorry no info avail
avrdude.exe: ser_recv(): read error:

Would anyone please help me. Thanks alot!

DrAzzy

Use MiniCore, not the older watterott core. https://github.com/MCUdude/MiniCore

That may not fix it, but that core is much more popular for the pb series, hence better place to get started.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

Zumii_Z

Thank you very much for the reply. I have tried with Minicore library. However , it's still not responding with stk5000_recv();

I am suspicious that my board is not compatible with the 328PB. I copied the circuit of Arduino Uno. I don't know whether that could be the problem?? :o  :o

srnet

I am suspicious that my board is not compatible with the 328PB. I copied the circuit of Arduino Uno. I don't know whether that could be the problem?? :o  :o
So check the pinouts in the appropriate datasheets, 328P versus 328PB, you will find a significant difference. ...........

A board built for a 328P will not be compatible with the pinout of the 328PB.
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

Zumii_Z

Thanks for your reply!

I checked the pinouts for 328PB. But the serial download still works with PD0(RX)PD1(TX) VCCIN and DTR. Basically, there's nothing different with code uploading circuit. The problem remains...  :(  :(

ron_sutherland

#5
Oct 12, 2018, 08:47 am Last Edit: Oct 12, 2018, 08:47 am by ron_sutherland
Look very close at pins 3 and 6 of the 328p-AU and 328pb-AU package (U may or may not show on the part).
I use an R-Pi Zero on an RPUpi shield to have a tool-chain at the network edge.

Zumii_Z

Look very close at pins 3 and 6 of the 328p-AU and 328pb-AU package (U may or may not show on the part).
Thank you for the advice. Yes, those pins have totally changed in 328PB. However, I have connected nothing with those pin 3 and 6 and only connected with what UART requires.

ron_sutherland

What board did you mount the 328pb on, was it some sort of breakout or was it done for a 328p which would have connected the pins to power and ground. Now that I said that... I wonder if floating pins could tolerate that?
I use an R-Pi Zero on an RPUpi shield to have a tool-chain at the network edge.

Zumii_Z

Thanks, everyone. I have made great progress. I tested by change the bootloader to use its internal crystal 8M/1Mhz and my simple code was able to be uploaded. Which is Great. But when I change the bootloader to 16Mhz external, it showed "avrdude: stk500_recv(): programmer is not responding" message again.

In that case, I think the problem lies with the fuse bits. It seems like the burning bootloader process fails to change the fuse bits or somthing..

Anyone have clue about that??

BJHenry

Or it could be a problem with your resonator/crystal.

Zumii_Z

This board has tested with 328P. So I guess the crystal works fine.

Zumii_Z

Ok, I checked with the PDF and found the clock was default by using its 8Mhz internal crystal. And it has to do with Fuse Low Byte / CKSEL0123. Here are the capture pictures of what I have found.
https://imgur.com/xCv4aXU
https://imgur.com/oOyANqz

ron_sutherland

If you switched the fuses back to use internal clock with a failed crystal that would be a neat trick. I have damaged a few crystals with a soldering iron, they do not like thermal shock.

What version of the IDE are you using?
I use an R-Pi Zero on an RPUpi shield to have a tool-chain at the network edge.

srnet

#13
Oct 12, 2018, 11:04 am Last Edit: Oct 12, 2018, 11:04 am by srnet
But the serial download still works with PD0(RX)PD1(TX) VCCIN and DTR. Basically, there's nothing different with code uploading circuit. The problem remains...  :(  :(
How does that relate to your statement in the fist post;

Quote
"Then, I have tried to upload my sketch to my project board like this but it responded nothing......".
I was actually responding to this;

Quote
But when I change the bootloader to 16Mhz external, it showed "avrdude: stk500_recv(): programmer is not responding" message again.
Check the pinouts of the 328P vs 328PB again.
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

Zumii_Z

Thank you for the reply. I am using 1.8.7 VERSION IDE.. and AVR board version is 1.6.23.
I found from board.txt that the fuse bit should be DE FF F4 to enable external crystal to work.
When I changed the fuse bits, the microcontroller still doesn't work.

Go Up