11 years, 4 months ago.

RS485: Are pins 9 and 10 5V tolerant when configured as TX and RX?

Just wanted to double check this as a I couldn't quite establish this from the datasheet. I want to add an RS485 datalink to the mbed and I though the easiest way would be to connect the TX and RX pins to a 485 chip such as the MAX485, MAX483 or ADM483 (these are all pin compatible) which all use a 5V supply. It looks like the logic thresholds are OK for inputs to the 485 chip but I have a slight worry about the connection between the receiver output (RO, pin 1) and the RX pin (pin 10 of the mbed). If RO puts out 5V will the mbed's RX pin be able to take it? If it was configured as a standard digital input then I think it would be OK since it is 5V tolerant, but is this still the case when configured as a serial port pin?

Incidentally, I see the Testbed for mbed board from ELMicro does something similar but the 485 chip doesn't connect to any of the onboard serial port pins. It goes to pins 21, 25 and 26 which I suppose you are meant to configure as standard digital inputs and outputs and then hand crank the serial comms rather than using the built in serial ports. Is there a reason it was done this way?

2 Answers

11 years, 4 months ago.

The inputs are all 5V tolerant. You can hook up the 485 RO pin to p10 of mbed without problems.

The mbed has several UARTs that you can use and some are available on multiple pins:

  • p25/p26 connect to serial comms UART1,
  • p10/p9 connect to serial comms UART3,
  • p14/p13 also connect to serial comms UART1,
  • p18/p17 also connect to serial comms UART3,
  • p27/p28 connect to serial comms UART2

So you can choose which pins to use and switch between them to avoid losing one of the alternate functions of the pins (eg I2C for p9/p10). ELMicro selected UART1 on the alternate pins p25/p26. I guess they use p21 to switch the 485 buffer between send and receive.

Accepted Answer
11 years, 4 months ago.

Thanks for that. Just one other thing - does this trick of using alternate pins (particularly p25 and p26) also work on the LPC11U24 or is it LPC1768 only?

The LPC11u24 has only one serial port UART available and even that is shared with the I/F for your pc debug channel (printf etc). However, the UART is accessible on multiple pins (p9/p10 and p24/p23). Most ARM I/O pins have multiple functions and most of the special functions are available on multiple pins to allow optimal use of all hardware features.

Regarding the serial port, since there is no second UART available, the best option if you need another one is to use a software implementation of a UART on one of the unused pins.

posted by Wim Huiskamp 04 Nov 2012