Author Topic: How does LED in arduino blinks when program gets uploaded?  (Read 1591 times)

0 Members and 1 Guest are viewing this topic.

Offline electrowhizTopic starter

  • Contributor
  • Posts: 28
  • Country: in
In arduino we will have LED . The LED will blink whenever program gets uploaded. How it happens? I didn't write any code for it? Is it the bootloader responsible for it?
 

Offline Brumby

  • Supporter
  • ****
  • Posts: 12298
  • Country: au
Re: How does LED in arduino blinks when program gets uploaded?
« Reply #1 on: May 14, 2018, 06:14:58 am »
Is it the bootloader responsible for it?

Yes.

It's an acknowledgement that data is being transferred.
 
The following users thanked this post: electrowhiz

Offline electrowhizTopic starter

  • Contributor
  • Posts: 28
  • Country: in
Re: How does LED in arduino blinks when program gets uploaded?
« Reply #2 on: May 14, 2018, 06:20:02 am »
Tanq
 

Offline darrellg

  • Supporter
  • ****
  • Posts: 105
  • Country: us
Re: How does LED in arduino blinks when program gets uploaded?
« Reply #3 on: May 14, 2018, 05:53:42 pm »
If you look at the schematic for the Uno (https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf), you can see that the TX and RX LEDs are conntected to the 16U2, not the 328P. The bootloader runs on the 328P, therefore the bootloader is not flashing the LEDs. The 16U2 is utilized as a USB to serial converter and is programmed to flash the LEDs when appropriate.

On Arduinos like the Leonardo (https://www.arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf), which don't have a separate chip for USB communication, the bootloader is responsible for flashing the RX and TX LEDs.
 
The following users thanked this post: Spudlicious, electrowhiz

Offline Richard Crowley

  • Super Contributor
  • ***
  • Posts: 4317
  • Country: us
  • KJ7YLK
Re: How does LED in arduino blinks when program gets uploaded?
« Reply #4 on: May 14, 2018, 07:27:49 pm »
It is not clear whether you are asking about:
1)  The RX/TX LED(s) that indicate data/programming activity.
2) The built-in LED connected to (typically) pin 13

Others have responded to your question if you are asking about (1) The RX/TX LEDs.

But if you are asking about the pin-13 LED:
Arduinos (genuine, clone, and work-alike) typically come with a demonstration program ("Blink") pre-loaded onto the microcontroller chip.  This provides a satisfying experience to the buyer (especially a first-time user). AND, it demonstrates that the chip and board are actually working BEFORE the user attempts to load any code of his/her own.  So at least the user knows that the board WAS working when they first received it.   :-DMM
 
The following users thanked this post: electrowhiz

Offline electrowhizTopic starter

  • Contributor
  • Posts: 28
  • Country: in
Re: How does LED in arduino blinks when program gets uploaded?
« Reply #5 on: May 15, 2018, 06:22:44 am »
Tanq for your wonderful information
 

Offline electrowhizTopic starter

  • Contributor
  • Posts: 28
  • Country: in
Re: How does LED in arduino blinks when program gets uploaded?
« Reply #6 on: May 15, 2018, 06:23:27 am »
Tanq for your information
 

Offline NivagSwerdna

  • Super Contributor
  • ***
  • Posts: 2495
  • Country: gb
Re: How does LED in arduino blinks when program gets uploaded?
« Reply #7 on: May 15, 2018, 06:32:18 am »
https://raw.githubusercontent.com/Optiboot/optiboot/master/optiboot/bootloaders/optiboot/optiboot.c

Flash at start and flash for each character received.

Nice to see the easy questions are back.  ;)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf