Reset pin and a MAX232

Hi,

As I understand it, when a computer connects to the serial device it sends the DTR pin as high, which results in resetting the Arduino, which allows the chip to be programmed. My two questions are this:

  1. Why do you need to use a 0.1 capacitor? Please explain in basic language I read online about differiental (or something), but I don't understand it.

  2. I also read that it's possible to connect the DTR line with a capacitor directly to the Reset pin because the DTR line only sends 10 volts, and the reset pin can tolerate 12 volts. Do you guys agree with this, and is there any documentation on that?

Cheers,

Cameron.

Look at this post:
http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection#.Uy3B3fldW_g
then look at this schematic:
You will see that the line coming from the FTDI ic (DTR signal) in the above post schematic for an UNO R3, is pin-13 of U3 in the
attached schematic. It is USB, not RS232 so there is no +/-12V signal.

  1. Why do you need to use a 0.1 capacitor? Please explain in basic language I read online about differiental (or something), but I don't understand it.

This post should answer your question because it shows the waveforms:
http://forum.arduino.cc/index.php?topic=145996.0
The short answer to your question is that the value of the cap is chosen based on the fact that the pullup resistor is a 10k pullup resistor and will start charging the cap as soon as RTS (from the computer) pulls DTR (on the arduino) LOW. If the pullup had been 100k, the cap could probably be 0.01uF. If the pullup resistor had been 1k, the cap would probably need to be 1uF. Why ? Because the resistor /capacitor form an RC circuit. You said in laymen's terms but here is the math: RC circuit - Wikipedia
T(seconds) = RxC = 10000*0.1 E-6 = 0.001 Seconds (1 mS)

  1. I also read that it's possible to connect the DTR line with a capacitor directly to the Reset pin because the DTR line only sends 10 volts, and the reset pin can tolerate 12 volts. Do you guys agree with this, and is there any documentation on that?

So here , the fact that you include the name MAX232 in your title , implies that this question is based on your intent to interface an old computer with RS232 (not USB) to an arduino. Perhaps it is a really old IBM-XT or something similar you got for free. The reason I say this is that your question makes no sense when you consider the fact that there is no RS232 on most modern computers and therefore no +/- 12V signal. Who knows why you didn't just come right out and say "I want to use an arduino with a old pc that only has RS232 (which actually is +/-9V on most old pcs , not +/-12V: +/-12V is generally only used for very long cable cruns, due the inherent noise immunity of such voltages. So now we have to forget about USB and what the rest of the world is doing and deal with this RS232 situation.

  1. I also read that it's possible to connect the DTR line with a capacitor directly to the Reset pin because the DTR line only sends 10 volts, and the reset pin can tolerate 12 volts. Do you guys agree with this, and is there any documentation on that?

First of all, you need to have the MAX232 convert the RS232 RTS signal to a TTL-LEVEL (0V/5V) signal. Don't even THINK about directly connecting ANY RS232 SIGNALS to the arduino. That is an absolute NO-NO !. So your question is now invalid. The max232 will convert the RTS signal (which you keep referring to as a DTR which suggests you are not aware of the handshaking involved. The signal you keep calling the DTR signal is DTR but it is receiving an RTS from the host pc, so at the arduino end it is the DTR signal, but since you have to use the max232 to convert the RS232 RTS to TTL level, then it is a 0V/5V signal at the arduino end. If you have done everything correctly , the resulting signal on the DTR pin of the arduino would be a LOW, which would pull the cap low as described in above post and reset the arduino.

Thank you for your very detailed explanation. I really appreciate it.

I am building a standalone Arduino with an MAX232 to interface with my USBtoRS232 convertor.

The TX and RX lines i am running through the MAX232, but the DTR pin 4 I directly connect to the capacitor on the reset pin because it stated it could handle voltages lower than 13, which I measured to be 9 volts.

Again. I really appreciate your answer.

Have a great weekend.

Cameron.

schematic ?
Project block diagram ?
code ?

cameronasmith:
Thank you for your very detailed explanation. I really appreciate it.

But - you did not understand it? Perhaps raschemmel was not quite clear.

cameronasmith:
The TX and RX lines i am running through the MAX232, but the DTR pin 4 I directly connect to the capacitor on the reset pin because it stated it could handle voltages lower than 13, which I measured to be 9 volts.

Well - just don't! You have that wrong on all counts. You need to connect RTS (DTR will work as well, but is not preferred) through the second channel you have available on the MAX232, which not only takes care of the wrong voltage, but also inverts the sense of the control line, and the output of that second RS-232 to TTL channel on the MAX232 you connect through the capacitor, to the reset pin.

The capacitor is needed because without it, asserting RTS will hold the reset active (low) for as long as the serial port is active, the ATmega chip would never actually start up and therefore would never be able to receive downloaded data. The capacitor simply causes the reset to be briefly activates sot hat it can then start up and process data.

Well it's not like I didn't try to explain that Paul. I guess it just didn't sink in.

First of all, you need to have the MAX232 convert the RS232 RTS signal to a TTL-LEVEL (0V/5V) signal. Don't even THINK about directly connecting ANY RS232 SIGNALS to the arduino. That is an absolute NO-NO !

Hello Paul.

Okay, I understand that I should be using the RTS pin, and not the DTR pin.

(this sounds like i'm being disrespectful, but i'm not :slight_smile: )
I'm sorry to ask the question again. but, why do I have to connect the RTS line to the MAX232 when I can just connect it to the reset pin with a capacitor? I know I have the spare pins on the MAX232, but i plan on using them for another Software Serial connection, and that is the reason why I cannot use them.

Sorry, if this is a dumb question.

Oh, and thank you for the capacitor explanation I understand it's purpose now.

Thank you again,

Cameron. - Sorry for the amount of questions.

Well - just don't! You have that wrong on all counts. You need to connect RTS (DTR will work as well, but is not preferred) through the second channel you have available on the MAX232, which not only takes care of the wrong voltage, but also inverts the sense of the control line, and the output of that second RS-232 to TTL channel on the MAX232 you connect through the capacitor, to the reset pin.

Put another way, ALL RS232 signals need to be converted by the max232. The DTR on the arduino is recieving the RTS from (we still don't know what ).

I'm sorry to ask the question again. but, why do I have to connect the RTS line to the MAX232 when I can just connect it to the reset pin with a capacitor?

Because RS232 is inverted logic from TTL
High on RS232 side is LOW on TTL side.
The High to LOW you need on the TTL side is the result of a LOW to HIGH (of the RTS) on the RS232 side.

The capacitor is needed because without it, asserting RTS will hold the reset active (low) for as long as the serial port is active, the ATmega chip would never actually start up and therefore would never be able to receive downloaded data. The capacitor simply causes the reset to be briefly activates sot hat it can then start up and process data.

Look at Reply #4 on this post: (the one I linked before that you obviously didn't read)
http://forum.arduino.cc/index.php?topic=145996.0

Hey, Raschemmel,

I don't think I was being rude to you and, in fact, I think I said saying thank you for your help. There are sometimes in life when you don't understand somethings, and if that makes you upset then instead of getting upset it might be best not to respond to that person.

BECAUSE RS232 IS INVERTED LOGIC from TTL !
HIGH ON RS232 is LOW on TTL SIDE OF MAX232.

Thank you this statement I understood.

Cameron.

cameronasmith,
I wasn't trying to be rude. If you notice, that was the only place I used caps in that post and if you recall, Paul_B tried to tell you the same thing. I gave you a link to a post with waveforms and it appears you didn't understand that. You could have researched the
Max232 and would have found this:on wikopedia:MAX232 - Wikipedia

Voltage levels[edit]

It is helpful to understand what occurs to the voltage levels. When a MAX232 IC receives a TTL level to convert, it changes a TTL logic 0 to between +3 and +15 V, and changes TTL logic 1 to between -3 to -15 V, and vice versa for converting from RS232 to TTL. This can be confusing when you realize that the RS232 data transmission voltages at a certain logic state are opposite from the RS232 control line voltages at the same logic state. To clarify the matter, see the table below. For more information, see RS-232 voltage levels.
RS232 line type and logic level RS232 voltage TTL voltage to/from MAX232
Data transmission (Rx/Tx) logic 0 +3 V to +15 V 0 V
Data transmission (Rx/Tx) logic 1 -3 V to -15 V 5 V
Control signals (RTS/CTS/DTR/DSR) logic 0 -3 V to -15 V 5 V
Control signals (RTS/CTS/DTR/DSR) logic 1 +3 V to +15 V 0 V

As you can see, the logic is inverted.
I apologize if you thought I was rude. I went back and changed my previous post to lowercase.
We are on Reply #8. I explained this to you in Reply#1 but you did not accept it.
From Reply#1

  1. I also read that it's possible to connect the DTR line with a capacitor directly to the Reset pin because the DTR line only sends 10 volts, and the reset pin can tolerate 12 volts. Do you guys agree with this, and is there any documentation on that?
    First of all, you need to have the MAX232 convert the RS232 RTS signal to a TTL-LEVEL (0V/5V) signal. Don't even THINK about directly connecting ANY RS232 SIGNALS to the arduino. That is an absolute NO-NO !.

Thank you this statement I understood.

Your welcome. In the future, perhaps you should do a little more research on Google before posting on the forum, to save everyone a lot of time. We are more that happy to help, but it is irritating when you give someone links to what they need to know and explain it to them in detail and they persist in trying to find a way not to follow your instructions because they don't want to spend another $5 for a max232 chip.

Hi raschemmel,

I'm sorry, you are right. I should have read more of the links you gave me. Thank you for all the information. I will in the future read your replies better.

I'm going to buy another MAX232, and follow your advice :slight_smile:

Thank you, and i'm sorry for all the extra work. I do really appreciate it.

Cameron.

There is another matter - you have proposed on a couple of occasions that "the reset pin can tolerate 12 volts". the question is - from where did you get that dangerous concept? We would not mind knowing, as it suggests the possibility of some other source of misleading information floating about somewhere.

The fact is, the reset pin can indeed accept 12 volts, but that is the very last thing that you would in this circumstance, ever want to do! The 12 volt functionality is used to put the chip into "High Voltage Programming" mode, used to implement otherwise protected programming functions. Doing so randomly may not actually cause problems, but clearly poses a risk of scrambling the chip. Not what I believe you would have intended.

To avoid problems with the auto-reset feature and the DTR, I just don't conect the DTR to the Arduino. When I use the MAX232 I just conect TX, RX and ground. Whenever I want to upload a sketch to the standalone, I press the reset button when the IDE says "Uploading". This has worked for me always. But an important detail: I've tested this with Arduino Diecimilla and Duelmilanove bootloaders, not tested yet with the optiboot (UNO bootloader). Anyway, you can downgrade the UNO bootloader to the Duelmilanove bootloader, they are almost the same (I guess).

Regards.

mart256:
Whenever I want to upload a sketch to the standalone, I press the reset button when the IDE says "Uploading". This has worked for me always.

And of course you can.

The "Auto-reset" is basically a convenience. It is however, a "right royal pain" to have to keep on doing this time after time when you are "smoke testing" sketches with minor modification - which is the primary method of debugging on the Arduino.

There is no reason manual reset - if you get the timing right - will not work perfectly well on the UNO.

Can you clarify something for me. The reference to "standalone" in this conversation. does that mean a breadboarded 328?
I have a bunch of Max232's as well as a TTL-RS232 converter and a Radioshack RS232-USB cable. So does that mean I don't have to use my SPARKFUN FTDI BASIC to upload sketches to my breadboarded 328 ? That I can just plug my RS232 to USB cable into my
RS232-TTL converter and connect the TTL Tx & Rx to my breadboarded 328 and connect the USB end to my PC and use the IDE
like I do with everything else but just hit the reset button on the standalone when I see "uploading " and that will work ?

I don't see why not.

It is a curious way of doing it since the USB to RS-232 cable already incorporates a MAX232 to generate the specified voltages - in fact, that is the original intent of a FTDI FT232 chip - to interface with a MAX232 in a USB to RS-232 adapter. So you would essentially be connecting two MAX232s back-to-back. The only problem will be figuring whether you need to swap TX and RX.

raschemmel:
So does that mean I don't have to use my SPARKFUN FTDI BASIC to upload sketches to my breadboarded 328 ? That I can just plug my RS232 to USB cable into my
RS232-TTL converter and connect the TTL Tx & Rx to my breadboarded 328 and connect the USB end to my PC and use the IDE
like I do with everything else but just hit the reset button on the standalone when I see "uploading " and that will work ?

Yes, that's exactly what I do on my proyects, and is cheaper than buying the FTDI bridge (I bought the USB/RS232 adapter for 3 bucks at ebay). FTDI=MAX232+USB to RS232 cable.

Great ! I'll try it the first chance I get .