function of bootloader

Thread Starter

bhuvanesh

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

MrChips

Joined Oct 2, 2009
30,714
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.
 

Thread Starter

bhuvanesh

Joined Aug 10, 2013
268
Rich (BB code):
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 microcontroller.help me to come out of this choas
 

Shagas

Joined May 13, 2013
804
SPI
UART/USART
TWI

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.
 

donpetru

Joined Nov 14, 2008
185
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:
http://www.ebay.com/itm/USB-ISP-Pro...Electrical_Test_Equipment&hash=item5af406b82b
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.
 

ErnieM

Joined Apr 24, 2011
8,377
When will the world learn that it is pointless to complication with Arduino, you can simply program the MCU using SPI interface.
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.
 

Sensacell

Joined Jun 19, 2012
3,432
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
 

russ_hensel

Joined Jan 11, 2009
825
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.
 
Top