Arduino Forum

Using Arduino => Microcontrollers => Topic started by: Bouni on Jul 22, 2015, 09:23 am

Title: Get the bootloader to a 32U4 using a Leonardo
Post by: Bouni on Jul 22, 2015, 09:23 am
Hi erveryone,

i currently develop a small board for a Kids solder workshop and try to get the bootloader to the 32U4 on the board using a Arduino Leonardo as progammer, but without success so far :(

Here is the schematic to the board.



My questions are:

1. Is it possible to upload the bootloader to the 32U4 using a Leo?
2. how can i make sure the processor is running (i have an oscilloscope here).
3. Can anybody spot a major flaw in my schematic?


Thanks so much for any kind of help!
Title: Re: Get the bootloader to a 32U4 using a Leonardo
Post by: (deleted) on Jul 22, 2015, 09:31 am
(deleted)
Title: Re: Get the bootloader to a 32U4 using a Leonardo
Post by: Bouni on Jul 22, 2015, 10:34 am
Hi,

the reset is connected, its just not clearly visible in the schematic.

I've connected it this way:

Leonardo Pins32U4 ISP Header
10RESET
5V5V
GNDGND
SCKSCK
MISOMISO
MOSIMOSI


Is that correct?

Furthermore I've uploaded the "Examples -> ArduinoISP" sketch to the LEO and extended the "C:\Program Files (x86)\Arduino\hardware\arduino\avr\programmers.txt" with these lines:


Code: [Select]

arduinoispleo.name=Arduino as ISP (Leonardo)
arduinoispleo.communication=serial
arduinoispleo.protocol=arduino
arduinoispleo.speed=19200


Then I've selected "Tools->Programmer->Arduino as ISP (Leonardo)" and hit "Burn Bootloader"
It takes a while and then shows timeout errors from avrdude i think.

Any Ideas what I'm doing wrong?
Title: Re: Get the bootloader to a 32U4 using a Leonardo
Post by: Maverick71 on Jul 22, 2015, 12:45 pm
Hi,

Can You please post a high resolution image of the shematic?
I cant see anything (importand Details) on this image.

I posted similar project with another Problem.
Mine doesn't reset correctly on second upload over USB.

Basically programming over ISP should be without any problems on this Chips.

Regards,
Mav.
Title: Re: Get the bootloader to a 32U4 using a Leonardo
Post by: dmjlambert on Jul 22, 2015, 03:56 pm
On the Leonoardo when used as a programmer, the SS pin is pin 17, which is not on the header anywhere.  Pin 17 runs the RX LED.   So, you need to edit the ArduinoISP sketch to change

#define RESET     SS

to

#define RESET     10

Title: Re: Get the bootloader to a 32U4 using a Leonardo
Post by: Bouni on Jul 23, 2015, 05:46 pm
Hi,

@Maverick71: The image is hosted on imgur, here's a direct link: imgur link (http://i.imgur.com/dCSgazm.png)

@dmjlambert: I've done that but forgot to mention it in my last post.

I've done some further tests, all VCC pins have the 5V and all GND have the GND connection.

Here's a picture that shows front and back layout: imgur link (http://i.imgur.com/2dvxLGl.png)
Title: Re: Get the bootloader to a 32U4 using a Leonardo
Post by: dmjlambert on Jul 24, 2015, 01:04 am


Select Tools->Programmer->Arduino as ISP
Do NOT select Tools->Programmer->Arduino as ISP (Leonardo)  ---you do not need that programmers.txt entry.   

I also recommend going in the IDE preferences and checkmark the show verbose output during upload option.

Title: Re: Get the bootloader to a 32U4 using a Leonardo
Post by: Maverick71 on Jul 25, 2015, 12:39 am
Hi,

I have looked on Your shematic.
You dont have got reverse blocking diode between VCC and USB VCC but this should be not a problem for a test.

1) I used my UNO as programmer but Leonardo must work too.

2) a) LED 13 should "pulsing" for some seconds after You make manual RESET.
    b) Unplug the new Leonardo. After new connection You will see "Leonardo" as USB Device.

3) a) I guess You connected the RESET properly like some people told You allready.
    b) Reverse blocking diode on RESET is missing too.
    c) I dont know if a missing ferrite can make a problem. I'm using 2 of them.

Generally, I would suggest as for the first step You should check if You can reach the ┬ÁC.

Regards,
Maverick
Title: Re: Get the bootloader to a 32U4 using a Leonardo
Post by: Bouni on Aug 03, 2015, 03:04 pm
Hi,

sorry for the long silence  :smiley-sweat:

I made some progress! The main problem was that i bought dirt cheap 18pF capacitors from China.
With those the crystal doesn't oscillate at all. I fixed that quickly with way to large, but working 1206 caps for the test.

That way I was able to flash the bootloader using an STK500.

Unfortunately the Board is not recognized by may notebook if i plug it in via USB.
Strangely it is recognized if i have the STK connected to the ISP header at the same time!?

Is that maybe a problem with my Reset Pullup? (I had no external resistor soldered in during the test)

Title: Re: Get the bootloader to a 32U4 using a Leonardo
Post by: Maverick71 on Aug 03, 2015, 05:18 pm
Hi,

Sounds like You have got a Problem with GND.
Double check Your traces.

Can You please give me Your Email or Skype name?
Im developing something similar.
Together we would be faster.

Regards,
Maverick