Bootloader (Nick's bootloader) 8 MHz works, 16MHz doesn't work for my chip

Hope everyone stay safe!

These days, I designed a pcb by using ATMEGA 328P(16mHz chip). When I loaded the Nick's bootloader, it was very strange that the 16mhz bootloader cannot work properly but 8 MHz could.

The whole story is:
First, I loaded the Nick's bootloader in an arduino nano and used it as programmer. Then in the serial monitor, I selected "16mHz" and burned the bootloader into my chip in pcb. However, when the burning finished, the program shows "no error found" but there is no LED blink (I added a LED in pin 13) on my board. So I tried to load basic "blink" code in example to see if the bootloader is burned correctly. Each time I click "upload", I got a "no response time out" through Arduino IDE.
((avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe6))

However, when I selected "8mHz" bootloader in Nick's bootloader, I got a "success" and LED fast blinking (500ms cycle I think?). And the "blink" code is no problem uploading although the blinking cycle is doubled.

I know the bootloader is fine since lots of people are using it. It must be my settings. I'm very new to the Arduino and hope learn something from this forum. This issue made me frustrated and I really hope someone can help me out.

Any help is appreciated!!

Thanks
Bests

Hope everyone stay safe!

These days, I designed a pcb by using ATMEGA 328P(16mHz chip). When I loaded the Nick's bootloader, it was very strange that the 16mhz bootloader cannot work properly but 8 MHz could. I know the bootloader is fine since lots of people are using it.

The whole story is:
First, I loaded the Nick's bootloader in an arduino nano and used it as programmer. Then in the serial monitor, I selected "16mHz" and burned the bootloader into my chip in pcb. However, when the burning finished, the program shows "no error found" but there is no LED blink (I added a LED in pin 13) on my board. So I tried to load basic "blink" code in example to see if the bootloader is burned correctly. Each time I click "upload", I got a "no response time out" through Arduino IDE.
((avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xe6))

However, when I selected "8mHz" bootloader in Nick's bootloader, I got a "success" and LED fast blinking (500ms cycle I think?). And the "blink" code is no problem uploading although the blinking cycle is doubled.

I know the bootloader is fine since lots of people are using it. It must be my settings. I'm very new to the Arduino and hope learn something from this forum. This issue made me frustrated and I really hope someone can help me out.

Any help is appreciated!!

Thanks
Bests

Doesn't seem like you are getting the fuses set up and are running on the internal 8 MHz oscillator.
Do you have a 16 MHz crystal in your PCB? Please post your schematic.

I think there is some problem with the fuse settings. Using avrdude try to reconfigure it to use the external oscillator.

It looks like this is not a beginner level project.

What's the reason for the want of a restricted 16MHz bootloader instead of the universal 8MHz one?

Hi DrDiettrich,

Thanks for the reply. Sorry for the misleading. I use ATMEGA 328 (Arduino Nano) for learning Arduino. I thought the 16 mHz is pretty normal for this ATMEGA 328 chip. So I designed this PCB with 16 mhz crystal (I attached ebay link below).

Oh, and also, do you think it is because I use a 3.7v lipo for power?

Thank you, I'm very appreciated.

https://www.ebay.com/itm/10pcs-16m-16-000m-16mhz-16-000mhz-passive-crystal-5032-5mm-3-2mm-smd-2pin/332713220457?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649

I think that you need to run the ATmega328 from a 5V supply for it to operate at 16MHz.

From page 2 of the ATmega328 datasheet :

 Speed Grade:

0 - 4MHz@1.8 - 5.5V, 0 - 10MHz@2.7 - 5.5.V, 0 - 20MHz @ 4.5 - 5.5V

m_k_akash:
I think there is some problem with the fuse settings. Using avrdude try to reconfigure it to use the external oscillator.

Hi m_k_akash

Thanks for your reply. I just followed the tutorial on Youtube about how to use Nick's bootloader for 8 mHz and 16mHz. That guy didn't make any change when upload the code so I didn't. But thank you, I will check the fuse settings right now and do some google searches to see how to set them up. Will get back soon!

Thank you so much, very appreciated for your help!!!

Check this ,its Nick's tutorial to burn the bootloader it's very easy, surely help you out

CrossRoads:
Doesn't seem like you are getting the fuses set up and are running on the internal 8 MHz oscillator.
Do you have a 16 MHz crystal in your PCB? Please post your schematic.

Hi CrossRoad,

Thanks for your reply. Yes, I have an external crystal with the ATMEGA 328 chip. But right now I'm thinking about maybe I used the wrong crystal.

https://www.ebay.com/itm/10pcs-16m-16-000m-16mhz-16-000mhz-passive-crystal-5032-5mm-3-2mm-smd-2pin/332713220457?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649

This one is much different than the one I usually use, I just find this one is the only one available in the lab so I grabbed it without checking the datasheet. Also I posted the schematic in attachment.

And speaking of the crystal, I just realized, I use 3.7v lipo instead of the original 5V as power supply!! I will check the crystal and get back soon.

I'll check the crystal and at mean time, any thought is appreciated!!

Thank you

JohnLincoln:
I think that you need to run the ATmega328 from a 5V supply for it to operate at 16MHz.

From page 2 of the ATmega328 datasheet :

Hi JohnLincoln,

Right now I'm using the usb as power supply so the power should be 5V. Unfortunately, the problem still there. I'll check the datasheet and get back soon

Very appreciated for your help!!

The bootloader runs AFAIK with the internal 8MHz RC oscillator, independent from external components. A 16MHz bootloader will only work on 5V systems with a 16MHz resonator/quartz, while the 8MHz versions runs everywhere.

Have you tried the "burn bootloader" option in the Arduino IDE ?

...R

PS ... I run all my standalone Atmega chips with the internal 8MHz clock so I don't have experience with running them at 16MHz. I like having a minimum of external components.

If you have an extra Arduino Uno , try placing the ic in it and burn the bootloader , I suggest it because it already has a 16mhz crystal in it

@geraffe

TOPIC MERGED.

Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum.

ballscrewbob:
@anon66737773

TOPIC MERGED.

Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum.

Hi ballscrewbob,

Got it. Sorry for duplicating the topic. I'm pretty new to the forum and just find out the right place for this topic after I made the first post. So I copy it one more time. If this makes someone uncomfortable, I'm truly sorry about that.

Thank you,

C3 should have just been Aref to Gnd, not 5V.

Should have 100nF caps on Vcc pins 4 and 6 to Gnd also.