Go Down

Topic: using leonardo to upload sketches to atmega168/328 (Read 2 times) previous topic - next topic

riyadhalnur

I bought a Leonardo recently. I know how to burn the arduino bootloader on a new atmega8/168/328. what I can't find out is how to then upload my sketches on that processor using the Leonardo. the tutorial on the arduino site uses uno which has a removable microcontroller but the Leonardo doesn't have that option. how do I go about doing that?

reason for doing this - i'm building an arduino on a breadboard but I don't want to buy an FT232 breakout board

Nick Gammon

You want to use the Leonardo as an ISP programmer, is that it?

riyadhalnur

yes...i wnt to use it to burn the arduino bootloader onto blank atmega chips and then use it to upload sketches to the newly bootloaded chip becuase i don't want to buy an FT232 breakout board

PeterVH

That question came up before, two options were given over here: http://arduino.cc/forum/index.php/topic,122973.msg924852.html#msg924852

If your goal is just to run some code on the targets, you are better off without bootloader: just burn your compiled sketches with ArduinoISP (I assume you used that to burn the bootloader into the targets?)

If you really want to use the target as an arduino on a breadbord, and program it from the IDE etc... You'd need to run a sketch on the leo that copies everything received from Serial (usb) to Serial1 (the regular uart) and vice versa. You'd have to connect  respectively  tx/rx on the leo to rx/tx on your target.

You can even combine the two functionalities into one sketch and use a jumper to select between isp mode and usb2serial mode (I saw the idea here: http://arduino.cc/forum/index.php/topic,101690.0.html, though the situation with the leonardo is a bit simpler: augmenting a sketch (ArduinoISP) with USB to serial conversion instead of adapting a bootloader)

simplex

Uno and Leonardo can be used as true ISP programmers/basic debuggers for most target AVRs. You do not have to remove any chip and you do not need to burn any bootloader.
The main idea is to use avrdude:
see: http://arduino.cc/forum/index.php/topic,125248.0.html
(Have enough patience and read the topic to the end.)
When I have time I will make a step by step tutorial.

Go Up