Arduino Leonardo using FTDI module connected to pin0 and pin1...?

Hi guys,

Don’t laugh… I am going to ask a strange and may be not a logical question. But I would appreciate very much if someone would help me with this:-)

Here it comes:

Is it possible to upload a sketch to Arduino Leonardo using FTDI module directly connected to the serial pins (pin0 (Rx1) and pin1 (Tx1)) of Arduino? I used to upload my sketches using FTDI to Arduino Uno, but I wonder if it is also possible in anyway to Arduino Leonardo! I use FTDI DEV-09716 from Sparkfun. Probably the boot loader has to be modified?!

Of course I have to make some modification like:

  • connecting 100nF between the reset pin and DTR,
  • 1k resistor from DTR to the ground; just like the UNO.

If the answer is no, is there any away that I can use FTDI and the serial pins of Leonardo to up load my sketches?

Thank you very much in advance for your suggestion, advice, hint, or solution :slight_smile:

This is possible if you change the bootloader. Maybe you can simply use the UNO bootloader but I haven’t checked that. The bootloader for the Leonardo (caterina) is accepting the code only from the USB interface.

Hello pylon,

Thanks for your suggestion. Yeah, I thought also that the boot loader of Leonardo expects the sketches on D+ and D- pins, but not at the serial port. I was thinking also to modify the pin assignment in the boot loader of Leonardo so that sketches can be uploaded through Rx1 and Rx2. But I don't know where I can find the source code of the boot loader for Leonardo. Do you have any idea?

The whole idea is: eventually I want to upload the sketches through bluetooth, but first the uploading must work with FTDI.

The bootloader sources are in the hardware/arduino/bootloaders directory of your Arduino IDE installation. The one for the Leonardo is caterina.

If you wanna upload your sketches by bluetooth you get another problem: How to reset the Arduino to be ready for a new sketch (or get to the bootloader code otherwise)?

Thank you. I will look into the source code of the boot loader. If I can understand it and can make any modification is an issue which I will come across soon:-)

I haven't figure out yet how I reset the Ardunio when uploading the sketches, but that is another thing I have to worry about later. To be honest, I hope to find some solution in:

ame2.asu.edu/staff/kidane/ArdWilessBtProg.pdf
and

Hi Elexy,

I am looking forward to hearing about any progress you are making.
The idea to hook up a bluetooth module is similar to what I am trying to achieve. I want to do this with a Wifi module (The WiFly from Roving networks).
So if there is any progress here, I will probably get myself an Arduino Leonardo instead of the regular Uno.
So, I hope it goes well.

P.S. Have you thought about using the ICSP header to program the board? Or does that require an AVR programmer? I don't remember.

Hey draft,

Thanks for your reply. Yeah, to use ICSP, you need some programmer, and I am new and not really familiar programming using ISCP. May be now it is time to learn about it. I jut love the Arduino IDE: easy to use and very effective most of the time.

It sounds you are busy with an interesting project: using wifi module to upload your sketch to Arduino!

Sure, I will inform you if I make some progress in this, but then I would ask you the same regarding your project:-)

Take care.

This should be possible but you'll need to recompile the Uno's "optiboot" bootloader for the ATMEGA32U4 (you can change the target in the Makefile).

daft:
The idea to hook up a bluetooth module is similar to what I am trying to achieve. I want to do this with a Wifi module (The WiFly from Roving networks).

Hi,

I am working on something very similar at the moment. Technically, uploading sketches via WiFly module should be no harder than a walk in the park. All that's needed is to connect one of DIO pins of the Roving module with Arduino reset pin via capacitor, using pretty much the same shematics as in Arduino UNO or Pro mini.
The software on PC side will have to put RN module into a command mode first ($$$), set that pin HIGH (set sys output), resetting Arduino, then leave command mode (exit) and start uploading the sketch.
That should work, providing that sketch does not contain binary pattern that would put RN module back into command mode.

BlinnovDotCom:
Hi,

I am working on something very similar at the moment. Technically, uploading sketches via WiFly module should be no harder than a walk in the park. All that's needed is to connect one of DIO pins of the Roving module with Arduino reset pin via capacitor, using pretty much the same shematics as in Arduino UNO or Pro mini.
The software on PC side will have to put RN module into a command mode first ($$$), set that pin HIGH (set sys output), resetting Arduino, then leave command mode (exit) and start uploading the sketch.
That should work, providing that sketch does not contain binary pattern that would put RN module back into command mode.

All right, that sounds do-able. However, how can I check if the sketch that I send to the Arduino does not contain a binary pattern that sets the RN module into command mode? Also, would this binary pattern represent the command mode string ($$$)?
Would you use the standard Arduino IDE, or would you advice something else? (Eclipse maybe?)

This is not necessary as the command sequence has to be surrounded by pauses of 250ms (as far as I remember). If you transfer a compiled sketch it may contain the three bytes “$$$”, if there are no pauses before and after the three bytes the RN module will not go into command mode.