How to avoid the delay during power ON the atmega2650 chip

Hi,

I am using atmega2560 chip. I have burnt the bootloader using usbasp programmer.
I am uploading the program into my atmega2560 chip through usb to serial convertor Via Tx, RX & DTR pin. This Tx and Rx pin is only to upload the program into my atmega2560 chip.

My problem is, i have uploaded the code. During power OFF and ON, i am turning ON the LED. I am seeing some delay of 5 - 6 secs during the power ON, after that the LED is turning ON.

Condition1: whenever i connect my serial to usb convertor board and i am power OFF and ON the atmega2560 chip, i am not seeing the Power ON delay.

Condition2: without connecting my serial to usb convertor board and i am powering OFF and ON the atmega chip, i am seeing the delay of 5-6 sec during power ON to turn ON the LED.

Why i have an issue of power ON delay while not connecting the usb to serial convertor? What could be problem. Kindly let us know.

This may contain some information to explain your delay

1 Like
  • We need to see your code.

  • If there is a Bootloader installed, at power up time the Bootloader code checks for incoming code, hence delay.

  • Programming the controller with ICSP removes the bootloader, power up delay is therefore diminished/removed.

1 Like

Hi sir,

Thanks for the reply. I need a bootloader function. Bootloader code will check for incoming code in the serial port? Whenever i connect my usb to serial convertor, i didnot see that power ON delay. Kindly let me know.

Hi sir,

I have bootloader delay of 6 to 8 sec during power ON. Some of the search result showing the bootloader delay will take 1 to 2 secs. Is there any new bootloader which reduces the boot time which can be burnt using usbasb programmer.? Kindly let us know. 1 to 2 secs delay is ok for me.
Thanks.

Optiboot takes 1-2s of startup delay.
The normal 2560 bootloader is stk500v2, which takes longer.

I think if you run "megacore", it uses either optiboot or something newer, with the lower delay.

1 Like

Hi sir,

Thanks for the reply. How to use megacore in my project. I need all arduino functions like delay, uart with 16 Mhz external crystal. Kindly let us know.

Install as per GitHub - MCUdude/MegaCore: Arduino hardware package for ATmega64, ATmega128, ATmega165, ATmega169, ATmega325, ATmega329, ATmega640, ATmega645, ATmega649, ATmega1280, ATmega1281, ATmega2560, ATmega2561, ATmega3250, ATmega3290, ATmega6450, ATmega6490, AT90CAN32, AT90CAN64 and AT90CAN128 (it supports all the Arduino functions.)

1 Like

Hi sir,

With the old bootloader, i tried with rx pin to ground and found there is no delay during Power ON. I understand that bootloader skips the incoming data while grounding the rx pin and goes directly to execute the sketch. Is that correct sir.?

Huh. I don't know; I hadn't heard that before! I looked at the code, and it doesn't mention that feature, nor do I see code that explicitly implements any such thing.
It COULD still be a side effect of what the UART sees when Rx is grounded (essentially a BREAK condition, or perhaps a string of 0 (null) characters.)

It's an interesting idea, though. It COULD be implemented...

2 Likes