Go Down

Topic: Why the boat loader ? (Read 1 time) previous topic - next topic

sparkylabs

I'm slightly confused as to what the boot loader is for. Surely all neccesary code can be loaded as the sketch and surely the chip doing the USB communication can emulate the ICSP ? Just wondering.

The reason i ask is i wonder if the platform will ever extend to smaller chips for more compact projects like the ATtiny's ?

The other thing I'm wondering is there are menu items in the IDE that refer to burning the boatloader to the MCU and loading the program with an AVRISCPII ? so potentially standalone projects could be more easily updated ?

Coding Badly

The reason i ask is i wonder if the platform will ever extend to smaller chips for more compact projects like the ATtiny's ?


Yes.  For a few years now.  This should get you started...
https://www.google.com/search?q=arduino+attiny

liudr

A TTL USB adapter and a bootloaded ATMEGA is a simple recipe. I am not sure if you can program any TTL USB adapter to use ICSP header. Some probably could. If you program a small chip with an ICSP programmer or another Arduino Dev board, you will erase the original bootloader (if the small chip had one) and your code will take the entire Flash as needed. Remember, Arduino is not a project that is trying to cram a project into the smallest and cheapest chips, like an engineering product.

James C4S


Surely all neccesary code can be loaded as the sketch and surely the chip doing the USB communication can emulate the ICSP

The elegant solution you suggest isn't so elegant.

The "USB" would have to emulate a device.  What device will you emulate?  The nice thing about looking like a USB modem  is that you don't need any actual drivers developed for all major platforms.  If you emulate something proprietary, that advantage goes away.

So okay you decide to emulate a usbmodem and just make the chip smart enough to know when it is boot loading.  That's complicated.  Also it means you have to have multiple IO pins connected to two devices.  Then what happens when you want to use USB to speak serial to the chip?  How will the "bootloader chip" know?  To talk serial it has to communicate to different pins.  So you Send an escape sequence?  That's bound to cause problems eventually in code that inadvertently sends that escape.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

DVDdoug

#4
Mar 27, 2013, 10:24 pm Last Edit: Mar 27, 2013, 10:27 pm by DVDdoug Reason: 1
I've worked on a couple of systems that didn't have one...  Typically, you'd have to BUY a hardware development system, a software development system, and maybe a separate programmer.  That's usually a few-hundred dollars, and it could run into thousands.   Oh...  You also need a power supply for the development board.

I was AMAZED that I could buy an Arduino (and nothing else), and in about 15 minutes I had compiled, uploaded, and was running the "blink LED" example.   That process usually takes about a day!   

Quote
Why the boat loader ?
:D :D It saves a boat load of time, trouble, and frustration.

retrolefty

The easiest method these days to program avr ATtiny processors using the arduino IDE (after modifying the IDE with the required ATtiny support files) is to utilize an inexpensive USBasp hardware programmer ($5) or using an arduino board running the arduinoISP sketch. Then develop your tiny sketch in the IDE and use the IDE file menu option of 'upload using programmer' to burn the sketch into the attached target ATtiny chip. So no bootloader code needed on the tiny.

Lefty

Coding Badly

Quote
Why the boat loader ?


At any given transfer rate, uploading through a bootloader is faster.

sparkylabs


Quote
Why the boat loader ?


At any given transfer rate, uploading through a bootloader is faster.



really we worry about transfer rate for a few KB of data ?

sparkylabs


The easiest method these days to program avr ATtiny processors using the arduino IDE (after modifying the IDE with the required ATtiny support files) is to utilize an inexpensive USBasp hardware programmer ($5) or using an arduino board running the arduinoISP sketch. Then develop your tiny sketch in the IDE and use the IDE file menu option of 'upload using programmer' to burn the sketch into the attached target ATtiny chip. So no bootloader code needed on the tiny.

Lefty



you validated my suggestion of using one avr as an isp programmer rather than as communicating with serial after using another programmer to "burn" a bootloader so that the chip can be programmed from a different software interface than the already hardware available ISP interface (bus)

So can the arduino IDE interface with the AVR ISP programmer and burn sketches directly without using the shield as a programming platform ? that would open up the possibility of writing direct from IDE to ATtiny's and any other non native arduino mcu.

My background is trying (trying being the operative word) to program mcu's from the vendors interface and software but not being a programming wizkid I keep stumbling around but I'm used to that freedom which I'm trying to keep to some extent with using the arduino whilst benefiting from the friendlier IDE (and support)

Lakes


sparkylabs

if the arduino IDE will work an AVRISP MK2 the "sketch" can be written straight to the ATtiny rather than involving the arduino hardware. if your programming the arduino hardware to act as the ISP and the IDE can control the actual AVR ISP unit then why not just program the mcu's (any be it the mega's or the tiny's) directly with that, if i have one, if not yes program the arduino to work as the ISP saving people from having to buy one.

Go Up