11

I'm making my own board and using an ATmega 328 with the Arduino bootloader. I have a DIP switch to select either an FTDI chip (for programming) to be connected to the ATMega's Rx and Tx, or a GPS that outputs serial to be connected. I was looking at this schematic for reference: http://arduino.cc/en/uploads/Main/ArduinoNano30Schematic.pdf

Why are there 2 resistors on Rx and Tx coming from the ATMega? Do I need those just for the connection to the FTDI chip, or do they need to be there for the GPS too?

Marcelo
  • 153
  • 1
  • 4
aloishis89
  • 1,660
  • 3
  • 13
  • 20

6 Answers6

11

One of them is there to prevent damage that could occur if the AVR has RxD programmed as an output, pins on both devices could be damaged if that happened as AVR pins can source and sink quite a lot of current. I don't think that the other resistor is necessary.

Leon Heller
  • 38,774
  • 2
  • 60
  • 96
  • If you're going to add hardware to compensate for possible firmware bugs, then the list never ends. I don't know much about AVRs, but most microcontrollers wake up with pins in high impedance state for exactly this reason. General pins don't become outputs until the firmware explicitly makes them so. Sometimes extra hardware to deal with likely bugs makes sense in prototypes, but for high volume products with tested firmware this is just a waste. Most digital outputs will survive fine when jammed together, although I wouldn't do this on purpose. – Olin Lathrop Jun 19 '11 at 21:04
  • 8
    The Arduino is generally used by people like art and design students, hence the need for safeguards like that. The OP shouldn't need resistors there. – Leon Heller Jun 19 '11 at 21:17
  • 1
    I think it *may* be possible to set the Rx on the FT232 as an output, in bit-bang mode. – Connor Wolf Jun 20 '11 at 05:36
  • 2
    @Olin Repurposing the pin as an output pin is quite common, being able to use it for both programming and general IO is a feature. PORTD is the only full 8 bit port you have on the arduino to play with so reusing the tx/rx lines is standard fare if you do not need to speak serial during normal operation. – John Meacham Jul 18 '14 at 10:04
7

It doesn't look like there is any good reason for those resistors. Both parts on that schematic appear to run on 5V with a common ground. There should be no need for resistors in the lines between the two chips.

If the lines were going off board, then there might be some point to putting resistors in series to protect the on-board parts, but that doesn't seem to be what's happening in that schematic.

Keep in mind this is a Arduino schematic. That means there is a good chance whoever designed it doesn't do this professionally. There are a lot of superstitions out there. Just because something is on the net doesn't mean it's done right.

Ricardo
  • 6,134
  • 19
  • 52
  • 85
Olin Lathrop
  • 310,974
  • 36
  • 428
  • 915
  • 6
    Arduino is specifically intended for people who are new to this. Therefore, designing the hardware to be tolerant software errors which could cause bus conflicts is common sense. I can see a very good reason for the resistors - People might accidentally set the TX/RX lines to outputs when they shouldn't be. – Connor Wolf Jun 20 '11 at 05:35
  • There are good reasons for the resistors to be there, please the check the other answers. – Marcelo Jan 24 '16 at 14:27
5

This is an old and already answered question, but I didn't find in any of the answers one of the good and possibly one of the most important reasons for the resistors to be there.

Although most people use the RX/TX only to connect the Arduino to their PCs for programming the chip and/or perform serial debugging, others use the Arduino's RX/TX pins to communicate it with other serial devices. In this case, the FTDI chip and this other device would conflict and it is very likely that will damage both due to short circuiting. These resistors "separate" the FTDI from the other device when there is one connected to the AVR RX/TX pins, protecting both and allowing them to be wired and connected simultaneously.

One thing to remember is that, once another serial device is connected to the RX/TX pins of Arduino, the resistors will mask the logical levels from the FTDI in a similar way that happens with pullup/pulldown resistors, so, the external device will have "preference" over the FTDI communication.

Marcelo
  • 153
  • 1
  • 4
  • 1
    this is exactly what i wanted to answer , and it is very precise since i have searched for this subject before . – ElectronS Jan 24 '16 at 14:21
  • You mean like this? http://electronics.stackexchange.com/questions/77562/arduino-uno-rx-tx-pins – Passerby Jan 24 '16 at 14:43
4

It could be done to prevent the other off board device is powering the Atmel when it is powered off. Due to current that runs via the internal clamp diodes of the Atmel...

user57449
  • 41
  • 1
  • Welcome to EE.SE! Generally we advice users to refrain from answering old questions unless the question is credible and doesn't have an answer. With that said, this specific question is over three years old and has an accepted answer. In the future please try to refrain from answering older questions since it brings the question to the top of the question feed on the front page and gives a messy look to EE.SE. Thanks! – Funkyguy Nov 03 '14 at 00:56
  • 2
    @Funkyguy the accepted answer is, while not an untrue observation, probably not the true reason. – Chris Stratton Nov 03 '14 at 05:12
2

Adding a small-value (100 ohms or so) series resistor on a signal which is going off-board can reduce RF emissions. The resistors on the illustrated schematic don't seem well-placed for that, though. Another use for resistors is as a really cheap mux. If the FTDI chip tries to drive the Arduino's RX pin and nothing on the header tries to, the FTDI chip will "win", but if something on the header tries to drive that pin without a series resistor, the device on the header will "win". That might explain some usefulness for the resistor on the Arduino's RX pin. Not sure what purpose the one on TX, serves, though, unless there's another external connection for the "TX" wire that's wired to the FTDI's RX pin and I'm just not seeing it (if there was such an external connection, it would be possible for the external device to inject data to be sent via the FTDI).

supercat
  • 45,939
  • 2
  • 84
  • 143
2

I have seen 100 ohm resistors on I2C and UART buses before, they are often for ESD protection. They work in conjunction with the built in clamp diodes in the MCU.

Thomas O
  • 31,546
  • 57
  • 182
  • 320