Arduino Forum

Using Arduino => Microcontrollers => Topic started by: Vincent19 on Jan 30, 2013, 11:21 pm

Title: The 0.1uF capacitors when using FTDI programmer
Post by: Vincent19 on Jan 30, 2013, 11:21 pm
Quote
The capacitor is there to turn the RTS signal into a pulse, so that when the computer brings RTS low, it briefly pulls reset low, and then the pull-up resistor charges the capacitor again, bringing reset high again.

Source : http://www.gammon.com.au/forum/?id=11637

Can anyone tell me about this ? I do not understand why it needs so. And is DTR =RTS ? My FTDI programmer are using VCC, RXD, TXD, DTR,CTS and GND pins

Thanks !
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: retrolefty on Jan 31, 2013, 12:54 am

Quote
The capacitor is there to turn the RTS signal into a pulse, so that when the computer brings RTS low, it briefly pulls reset low, and then the pull-up resistor charges the capacitor again, bringing reset high again.

Source : http://www.gammon.com.au/forum/?id=11637

Can anyone tell me about this ? I do not understand why it needs so. And is DTR =RTS ? My FTDI programmer are using VCC, RXD, TXD, DTR,CTS and GND pins

Thanks !


Why do you need to use DTR or RTS (yes you can use either but not both) ?

When you press upload on the Arduino IDE to upload a new sketch to an attached arduino board, the IDE needs to reset the attached arduino board so the bootloader on the board will start and communicate with the IDE to allow uploading the new sketch.

Lefty
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: Vincent19 on Jan 31, 2013, 12:57 am
Why not ? My ftdi programmer have the DTR pins and I am required yo connect it to reset pins via 0.1uF cap..but I do not know why
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: Grumpy_Mike on Jan 31, 2013, 01:07 am

Why not ? My ftdi programmer have the DTR pins and I am required yo connect it to reset pins via 0.1uF cap..but I do not know why

Your ftdi programmer connects to the reset pin. With serial you have no connection to the reset so the designers of the arduino decided to use the handshaking pin as a reset, rather clever I thought.
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: nickgammon on Jan 31, 2013, 01:48 am
RTS goes low, as shown here:

(http://www.gammon.com.au/images/Arduino/Minimal_Arduino11.jpg)

However we don't want reset to stay low, so the capacitor turns it into a pulse. Then 10K resistor then charges the cap back up and it becomes high, allowing the processor to run.
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: retrolefty on Jan 31, 2013, 01:56 am

RTS goes low, as shown here:

(http://www.gammon.com.au/images/Arduino/Minimal_Arduino11.jpg)

However we don't want reset to stay low, so the capacitor turns it into a pulse. Then 10K resistor then charges the cap back up and it becomes high, allowing the processor to run.


And that is why a wise person said "a picture is worth a thousand words".

Lefty
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: Vincent19 on Jan 31, 2013, 02:27 am
Does that means that I only have to connect RX, TX , gnd and vcc to MCU?
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: nickgammon on Jan 31, 2013, 03:26 am
Depends if you want auto-reset or not.
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: Vincent19 on Jan 31, 2013, 03:31 am
If I never connect the DTR pins, I still can load my program to chip using ftdi programmer ?
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: nickgammon on Jan 31, 2013, 05:27 am
If you don't connect the DTR/RTS via the capacitor you will have to manually reset the chip at the same time you upload a new sketch.
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: Grumpy_Mike on Jan 31, 2013, 11:52 am
But the timing has to be right, hold down the reset, select the program from the IDE, when it says loading, count one two three, and release the reset.
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: knuckles on Jan 31, 2013, 07:50 pm
on this link it shows the reset to reset connected with a cap in between and no mention of DTR CTS etc

http://openmicros.org/index.php/articles/88-ciseco-product-documentation/124-xb4a-how-to-build-arduino-compatible

why is that different ??
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: retrolefty on Jan 31, 2013, 07:55 pm

on this link it shows the reset to reset connected with a cap in between and no mention of DTR CTS etc

http://openmicros.org/index.php/articles/88-ciseco-product-documentation/124-xb4a-how-to-build-arduino-compatible

why is that different ??


Simply a misprint on that site's pin out of the 6 pin FTDI pin out, where it says RST it should say RTS. Either the RTS or the DTR signal can be used to generate the auto reset pulse, as the arduino IDE uses both.

Lefty
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: Vincent19 on Feb 01, 2013, 02:30 am

But the timing has to be right, hold down the reset, select the program from the IDE, when it says loading, count one two three, and release the reset.

Great info!!! Will have try it . And let you know soon !

Thanks :)
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: john1993 on Feb 01, 2013, 07:11 pm
dtr is preferred over rts because its much better behaved under windows.
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: Vincent19 on Feb 02, 2013, 02:48 am
Great ! How about CTS? What's that ?
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: retrolefty on Feb 02, 2013, 02:49 am

Great ! How about CTS? What's that ?


Not required in this application and can be left disconnected.

Lefty
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: Vincent19 on Feb 02, 2013, 02:53 am
When will CTS being used ?
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: retrolefty on Feb 02, 2013, 03:11 am
If the PC com link was set-up with the 'hardware handshacking' enabled, the CTS (clear to send) would be how the device would tell the PC it was ready to receive data if any is waiting to be sent. The comm port as used by arduino (and most all PC serial applications) use the 'no handshake' option choice to run the link at. There is also a 'software handshake' option where the two sides of a comm link send the ascii Xon and Xoff control characters to tell the other side to stop or start sending data. That is also not used in most PC applications. But both options are available for interfacing with such thing a older modems and other data communication devices.

Lefty

Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: john1993 on Feb 02, 2013, 05:23 pm

Great ! How about CTS? What's that ?


cts, dsr, ri, etc are inputs to the pc and therefor can never be used as arduino control bits.
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: Vincent19 on Feb 04, 2013, 05:40 pm

But the timing has to be right, hold down the reset, select the program from the IDE, when it says loading, count one two three, and release the reset.

I have tried this ! It's really do work well ! But the timing really have to be correct. Have to release the RESET button once the IDE shows 'uploading..'

Thanks ! Finally I understand why is there a cap there- to bring the RESET High and LOW. :)

When I want to upload a new sketch, the we should RESET our microcontroller so that the previous sketch is deleted and pull the RESET HIGH to allow the new program to load into ?

Am I correct ?

Thanks !
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: retrolefty on Feb 04, 2013, 05:51 pm
Quote
Thanks ! Finally I understand why is there a cap there- to bring the RESET High and LOW.


Well actually that should read 'to bring the reset Low then High'.  ;)

Lefty
Title: Re: The 0.1uF capacitors when using FTDI programmer
Post by: nickgammon on Feb 04, 2013, 08:32 pm
Resetting the processor does not delete the old sketch.