system
October 5, 2014, 6:51am
1
Hello there,
I've purchased an atmega328 with arduino uno bootloader. I wonder if I can use it with leonardo without burning the bootloader. There many tutorials available but nothing seems to cover my case.
Finally, how i'm gonna connect it to my leonardo ???
Thanks in advance,
Mikos Mikekos
Robin2
October 5, 2014, 7:18am
2
I presume when you say Atmega 328 you mean the same chip that is in an Uno.
There is no socket for any chip on a Leonardo so I don't know what you have in mind.
...R
If you are asking to use your Leonardo as an ISP programmer to program the m328p mcu then yes, you can. You don't need the bootloader. There are a number of posts that kind of show you but it's not clear. Like, Burning a Atmega 328 Bootloader with an Arduino Leonardo - Microcontrollers - Arduino Forum , Arduino Micro as ISP and atTiny84A - Installation & Troubleshooting - Arduino Forum
The basic summary to use your Leonardo as ISP:
Add a programmer.txt definition for the Leonardo as ISP.
Modify the ArduinoISP sketch from the IDE Examples.
Upload the sketch to your Leonardo.
connect up the pins from the Leonardo to the target m328p.
Select Programmer type for Leonardo as ISP
Use the IDE to upload a sketch via Upload Using Programmer to program your target m328p.
Select board type for Uno, (this requires that your target has a 16MHz crystal for it.)
Create a file under /{sketches}/hardware/myarduino/programmers.txt file. (Do this before starting the IDE)
arduinoispmicro.name=Micro/Leonardo as ISP
arduinoispmicro.communication=serial
arduinoispmicro.protocol=arduino
arduinoispmicro.speed=19200
Edit from examples ArduinoISP sketch. Change this line from SS to 10.
#define RESET 10
upload this sketch to your Leonardo.
Connect up the pins from the Leonardo ISP 6-pin header and pin D10 to the target m328p pins.
Leonardo target m328P(physical pin numbers)
D10 RESET pin 1
Leonardo
ISP header
MOSI MOSI pin 17
MISO MISO pin 18
SCK SCK pin 19
VCC VCC pin 7
GND GND pin 8
From the IDE select Programmer -> Micro/Leonardo as ISP
Select board type -> Uno
Open your sketch, then use Upload Using Programmer.