function of bootloader

Discussion in 'Embedded Systems and Microcontrollers' started by bhuvanesh, Dec 25, 2013.

  1. bhuvanesh

    Thread Starter Member

    Aug 10, 2013
    " bootloader helps to run run arduino code without any external hardware"
    i started to learn about microcontroller only by wat it mean external hardware.are we using bootloader to burn the code.what is the function of bootloader.please help me
  2. MrChips


    Oct 2, 2009
    In order to program a microcontroller chip you need a program.
    Atmel chips use the SPI interface in order to program the chip.
    Arduino, which uses Atmel chips, uses the UART port to program the chip. For this to work, you need to have a program in the chip. This is the boot loader program.

    If you erase the Arduino chip the boot loader will be erased and you will not be able to program the Arduino. You will have to install the boot loader once again.
  3. bhuvanesh

    Thread Starter Member

    Aug 10, 2013
    Code ( (Unknown Language)):
    1. Atmel chips use the SPI interface in order to program the chip.
    1)here atmel chip means microcontroller.what he is saying that microcontroller using spi interface to program microcontroller.what is he mean
    2)does spi is communication between microcontroler and other peripheral device like(ldr,sensors)or its a communication between usb and me to come out of this choas
  4. Shagas

    Active Member

    May 13, 2013

    Are all communication protocols . Read about them . Yes the SPI can be used for peripherals/sensors etc. Depends on what communication the peripheral/sensor supports

    By default the AVR (Atmel 8 bit microcontrollers) is programmed by SPI .
    A bootloader is a program already inside the Chip.The arduino bootloader allows the avr chip to be programmed by UART. Why UART? Because the arduino is programmed through the USB . The usb signal is first fed into a serial converter and can be read/spoken to by UART.
    bhuvanesh likes this.
  5. donpetru

    Active Member

    Nov 14, 2008
    When will the world learn that it is pointless to complication with Arduino, you can simply program the MCU using SPI interface.
    Or, if you want to program using the USB port, then you can use a circuit that is based on all Atmel MCU, like this:
    Cheap, simple and works great. And if you combine the above programmer with mikroC development solution (which contains a lot of examples), it is a good first step in programming Atmel MCUs.
  6. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    Haters gotta hate. There's many good reasons to use a bootloader. You may want your customers to be able to update firmware without using some external programmer, just use the device itself. That's exactly haw most programmers themselves work: you don't need a programmer to flash a programmer. You just send in the new information over whatever communication method is already there, be it RS-232, USB, or whatever.

    I once wrote bootloader that took the program information off an SD card on board the unit. You could drop programs onto the SD over the USB (it normally looked like a USB flash drive when connected to a PC).

    Ya ain't gonna do that trick with no SPI interface programmer.

    Bottom line: boot loaders let you program a micro without an external programmer.
  7. MrChips


    Oct 2, 2009
    I don't see anything wrong with the Arduino approach of using a USB-to-UART cable to program the chip.
  8. Sensacell

    Well-Known Member

    Jun 19, 2012
    There are many ways to get code loaded into a micro-controller, the main thing to consider is the context in which the process will need to happen.
    The method must be chosen carefully to meet the objectives of the situation.

    For example:

    Are you developing code? - Then you need a FAST way to update the code.

    Is the code to be loaded by a customer? - Then a Boot loader is essential

    Is this for production programming? - You could have the manufacturer pre-program the chips before installing them in the PCB.

    Is the code proprietary? - Consider encrypted boot loader options
  9. russ_hensel

    Well-Known Member

    Jan 11, 2009
    You asked what is the function of a bootloader.

    A bootloader is a program that gets another program installed on its host.

    A bootloader is a program that runs when the computer is booted ( reset and started ) and then looks at a communications line to see if there is a new program to be loaded via the comm line. If so it loads it ( while still keeping itself as the first bootable program ) and transfers control to the new program. If there is no new program it starts the last program that was bootloaded ( if any )

    It is usually consider an easy and useful way of installing a program on a microcontroller.