Go Down

Topic: Programming Arduino 328 MINI with Leonardo (Read 6462 times) previous topic - next topic

Kevlud

Hello ! I've got an Arduino LEONARDO and Arduino MINI. Simply, I want to send sketches from IDE to my MINI throught LEONARDO.

I've tried with Arduino as ISP, but it doesn't work. Even i tried to change all Serial to Serial1 in ISP sketch, but same result here. I don't know what to do, and i don't want to buy any AVR programmer.

So, could anyone help me? Thank you in advance.

CrossRoads

Try Nick Gammon's programmer.
http://www.gammon.com.au/forum/?id=11635
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Kevlud

#2
Apr 11, 2013, 07:17 pm Last Edit: Apr 11, 2013, 07:46 pm by Kevlud Reason: 1
Thank you for your answer ! But Leonardo is not listed here, should I use UNO method ?

EDIT : It looks like the Nick Gammon's programmer is only burning bootloader, isn't it ? I just want to upload sketch to my Arduino MINI thru LEONARDO.
(Because Arduino MINI doesn't have USB port.)

CrossRoads

Use a USB/Serial adapter and download your sketch via the Mini's serial port.
Its good to have some tools.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

PeterVH

Quote
EDIT : It looks like the Nick Gammon's programmer is only burning bootloader, isn't it ?

Yes, and that should work (or can be made to work) from the leonardo, but it is probably not needed since the mini comes with a bootloader preburned. So I would start checking the bootloader is still present and working by connecting a led and resistor to the mini's pin 13 and see whether it blinks at least briefly upon startup.

If it does, you can indeed use the leo as usb to serial converter. I see you already found my writeup http://petervanhoyweghen.wordpress.com/2012/11/08/using-the-leonardo-as-usb-to-serial-converter

You can simplify things a bit.
Using both of following simplifications you don't need to do the hacks described after the sketch  in the write up:
1. Use the sketch for the leo from the link above, but change the baudrate line like this:
Code: [Select]
static long baud = 115200;. This way the leo uses the same baud rate as the mini's boot loader from the beginning.
2. reset the mini manually (don't connect the mini's reset pin to the leo). Do you have the mini version with the reset button? If not wire one up.



Kevlud

Finally, it works ! Thank you guys for your advice and time !   XD

PeterVH

Great.
Do you use the leo or did you buy an usb to serial converter?
If you use the leo, could you post a picture of your setup?

Kevlud

So, I just used PeterVH's tutorial "ArduinoISP on the Leonardo" : http://petervanhoyweghen.wordpress.com/2012/09/16/arduinoisp-on-the-leonardo/.

I've edited Arduino as ISP sketch (changed #define RESET SS to : #define RESET 10) and made new programmer .txt file, just like in tutorial.

I uploaded edited Arduino as ISP sketch to my Leonardo. Then i connected my Leo to MINI like on this schematic :

Leo MISO ---> MINI pin 12
Leo SCK  ---> MINI pin 13
Leo MOSI ---> MINI pin 11
Leo pin 10 -> MINI RESET




Finally, choose in Arduino IDE new programmer :



Choose board :



Hit [font=Verdana]UPLOAD USING PROGRAMER[/font][/b] and it's DONE !

Hope you enjoyed !

PeterVH

Thanks, Kevlund. I'll place a link to this from my 'isp on leo' writeup.

Though actually I had hoped you used the 'leo as serial converter' approach. I planned to submit an enhancement request/pull request to integrate support for this this in the arduino core. This thread could help convince the developers... Well, when I find some time I'll submit my request...

Now you have something that works, you still might want to try the  'leo as serial converter' approach: right now you don't have a way to see Serial output from your sketches.

Kevlud

Don't worry, I'm going to try your 'leo as serial converter'  right now !  8)

coolf

hallo everyone,

i am drying to boot the bootloader from arduino leonard to an standalone Atmega32u4 (leonardo)

it am very thankfull for your post. Thank you.

Now I got to the point where I build the programmer.txt in the folder in hardware.


When i used Tool -> Bootloader installieren a errow massage came up:

"avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.
"

how could i solve the problem?

thank you for your time,
coolf


miguelkeenfolks

Buenas Arduineros,
Para solucionar eso, solo tenemos que elegir  como tarjeta "Arduino Micro" en vez de "Arduino Mini".
Saludos, Miguel.

miguelkeenfolks

Good Arduineros,
To fix that, we just have to choose as greeting "Arduino Micro" instead of "Arduino Mini".
Regards, Michael.

matoex

#13
Mar 16, 2015, 10:34 pm Last Edit: Mar 17, 2015, 05:27 pm by matoex
Hello.
I have got simillar problem. I am trying to upload "blink" sketch to my new Arduino Pro Mini using Arduino Leonardo as ISP. I connected like it is shown above, but I get error:

Quote
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.
Arduino IDE : 1.0.5-r2
Board : Pro Mini ATMEGA328 5V/16MHz
BOARD


Choosing "Arduino Micro" instead of "Arduino Mini" or "Arduino Pro Mini" doesn't help.

Please help. It just drives me crazy.
I spend really many hours trying to upload any sketch to Pro Mini and I still didn't success.


EDIT (1 day later):

OK, it finally works (pins didn't touch breadboard) !



ckuetbach

#14
Jun 01, 2015, 05:02 pm Last Edit: Jun 01, 2015, 05:03 pm by ckuetbach
Hello,

i did it like in this Answer of Kevlud

Everything works, but after uploading a sketch I have to rewrite the bootloader, otherwise I cannot upload a changed sketch.

I always get an verification error.

Any ideas?

Regards,

Christian

Go Up