Linksys WRT54GS serial interface

A serial port adapter for the Linksys WRT54G/WRT54GS router

Introduction

The WRT contains two serial ports, at CMOS levels. Using a serial line transmitter/receiver we convert these to RS232 levels.

See Rod Whitby's page for one way of doing this. I used that page as my starting point, and made a couple of SMT PCB layouts - just because.

I sold these for a while, mostly for fun. In the end, it wasn't economically feasible. They cost me too much work and money to build compared to what I could charge for them.

With a serial port connected to your router and a suitable cable between the router and your computer (a modem cable (not a null modem cable) for the DB9 version and a standard Cisco-style "rollover" console cable for the RJ45 version), just run minicom or Zterm or Hyperterminal or any other serial terminal program on your computer, open a connection to the serial port at 115200 baud, 8bits, no parity, 1 stop bit ("8N1") and start the router - you should see the startup messages rolling by at rather high speed.

If you need to access the CFE boot monitor on your WRT54GS, just press ^C while the router is waiting for a tftp connection. If boot_wait happens to be set to "off", you can still achieve this by hitting ^C repeatedly while connecting the power cable to the router. Try again if it doesn't work.

For more info on what you can do to your WRT, check out OpenWRT and Sveasoft.

You can find some interesting RS232 info at Interfacing the Serial/RS232 Port

DB9 version

 

PCB layout Standard version (see the "notes" section about JP1 rotation!)


PCB layout Rotated JP1 version (for WRT54G v2.2 and some newer WRT54GS models)

DB9 version serial interface (rotated JP1) layout mask preview

Refer to the notes section below for important notes on this layout!

Component list

  1. 1x ST3232 dual RS-232 driver/receiver, SO16
  2. 5x Kemet 0.1uF tantalum capacitor
  3. 1x 0.1" x 0.1" (2.54x2.54 mm) 10 pin socket connector
  4. 2x Micro-Match (AMP) low-profile 10 pin socket connector
  5. optional: 2x 0.1" x 0.1" (2.54x2.54 mm) 6 pin pin header + jumpers (see note below)

Notes

  • The star marks pin 1 on the IC.
  • The polarization key on the JP1 connector should point inwards from the front edge or the WRT PCB for the standard version. There is a mark on the WRT's PCB that shows on which side the key goes. If this mark is towards the edge you need the reverse version of this interface! Things will BURN if you put it in the wrong way!
  • Default setting for both ports is DCE - use a modem cable, not a null modem cable.
  • If you add a jumper block, cut the three obvious default connections on the PCB for that jumper block!
  • The capacitors are mounted with '+' towards pin 1,2,4 and 16, and with '-' towards pin 3, 5 and 6.
  • The Micro-Match connectors have a polarization hole on the 'pin 1' side.
  • The tts/0 and tts/1 connectors are designed to fit a cable-mounted DB9, and the pin numbers below match the numbering scheme of such a connector. Thus, they are numbered one row at a time, instead of the usual numbering scheme. The WRT PCB connector, however, is numbered in the conventional way.

Jumper blocks

J1
(tts/0, cua/0)
J2
(tts/1, cua/1)
Mode Connector
WRT54GS - J1/DCE J2/DCE DCE
(for connection to PC/terminal)
DB9 female/DCE
J1/DTE J2/DTE DTE
(for connection to DCE device
like a modem etc)
DB9 male/DTE

Pin connection table

WRT54GS JP1
Pin(s)Desig.DestDesig.
1,2 Vcc ST3232 pin 16 Vcc
3 tts/1 TXD ST3232 pin 11 T1in
4 tts/0 TXD ST3232 pin 10 T2in
5 tts/1 RXD ST3232 pin 12 R1out
6 tts/0 RXD ST3232 pin 9 R2out
7,8   NC
9,10 GND GND
tts/0
Pin(s)Desig.DestDesig.
1 DCD Conn. to pin 4&6 iff DCE
2 RD ST3232 pin 7 T2out
3 TD ST3232 pin 8 R2in
4 DTR Conn. to pin 6 and optionally pin 1
5 GND GND
6 DSR Conn. to pin 4 and optionally pin 1
7 RTS Conn. to pin 8
8 CTS Conn. to pin 7
Note: pin 2 & 3 switched if DTE
tts/1
Pin(s)Desig.DestDesig.
1 DCD Conn. to pin 4&6 iff DCE
2 RD ST3232 pin 14 T1out
3 TD ST3232 pin 13 R1in
4 DTR Conn. to pin 6 and optionally pin 1
5 GND GND
6 DSR Conn. to pin 4 and optionally pin 1
7 RTS Conn. to pin 8
8 CTS Conn. to pin 7
Note: pin 2 & 3 switched if DTE
ST3232
Pin(s)Desig.DestDesig.
1, 3 C1+ / C1- Connected via 0.1uF cap
2 V+ Connected to GND via 0.1uF cap
4, 5 C2+ / C2- connected via 0.1uF cap
6 V- Connected to GND via 0.1uF cap
7 T2out tts/0 pin 2 tts/0 RD
8 R2in tts/0 pin 3 tts/0 TD
9 R2out JP1 pin 6 tts/0 RXD
10 T2in JP1 pin 4 tts/0 TXD
11 T1in JP1 pin 3 tts/1 TXD
12 R1out JP1 pin 5 tts/1 RXD
13 R1in tts/1 pin 3 tts/1 TD
14 T1out tts/1 pin 2 tts/1 RD
15 GND GND
16 Vcc Vcc, GND via 0.1uF cap
Note: pin 7 & 8 resp. 13 & 14 switched if DTE

Cisco-style RJ45 version

RJ45 version outside view: The RJ45 (Cisco-style) version of the serial interface, installed in a Linksys WRT54GSThe RJ45 (Cisco-style) version of the serial interface, installed in a Linksys WRT54GS - inside view

PCB layout standard version

And yes, the layout isn't exactly as in the pictures - I rotated the connector after I built the first two boards.

PCB layout single-port version

This one is designed a lot like the dual-port RJ45 version but is intended to be used for other routers and other equipment that doesn't have the same connector pinout as the WRT54G/GS. The connector pads fit a Micro-Match 4-pin connector if you want to use that.

Component list

  1. 1x ST3232 dual RS-232 driver/receiver, SO16
  2. 5x Kemet 0.1uF tantalum capacitor
  3. 2x RJ45 PCB mounted connectors
  4. 1x 0.1" x 0.1" (2.54x2.54 mm) 10 pin female cable connector
  5. 1x Micro-Match (AMP) low-profile 10 pin cable to card connector
  6. A short piece of ten-strand flat cable

Notes

  • Pin 1 on the IC is upper left as the layout is shown here.
  • The polarization key on the JP1 connector should point inwards from the front edge of the WRT PCB for the standard version. There is a mark on the WRT's PCB that shows on which side the key goes. If this mark is towards the edge, you need the reverse version of this interface! Things will BURN if you put it in the wrong way!
  • The capacitors are mounted with '+' towards pin 1,2,4 and 16, and with '-' towards pin 3, 5 and 6.
  • This thing fits - upside down - on the right side of the router. It might also fit in the front but be careful to avoid collision with the main board connector!
  • To connect to a DCE device, use a straight cable. To connect to a DTE device (i.e. a terminal or computer), use an inverted ("rollover") cable - a standard Cisco console cable. Compare the colour-coded signal cables in the two transparent RJ45 plugs to see if they match. Don't use a crossed twisted-pair cable!
  • RJ45 pins are numbered 1-8 from left to right looking at the female connector from the outside. Note that on the pictures here, the connectors are upside-down!

Pin connection table

WRT54GS JP1
Pin(s)Desig.DestDesig.
1,2 Vcc ST3232 pin 16 Vcc
3 tts/1 TXD ST3232 pin 11 T1in
4 tts/0 TXD ST3232 pin 10 T2in
5 tts/1 RXD ST3232 pin 12 R1out
6 tts/0 RXD ST3232 pin 9 R2out
7,8   NC
9,10 GND GND
tts/0 RJ45 (DTE)
Pin(s)Desig.DestDesig.
1 RTS Conn. to pin 8 CTS
2 DTR Conn. to pin 7 DSR
3 TD ST3232 pin 7 T2out
4 CND GND
5 GND GND
6 RD ST3232 pin 8 R2in
7 RTS Conn. to pin 2 DTR
8 CTS Conn. to pin 1 RTS
tts/1 RJ45 (DTE)
Pin(s)Desig.DestDesig.
1 RTS Conn. to pin 8 CTS
2 DTR Conn. to pin 7 DSR
3 TD ST3232 pin 14 T1out
4 CND GND
5 GND GND
6 RD ST3232 pin 13 R1in
7 RTS Conn. to pin 2 DTR
8 CTS Conn. to pin 1 RTS
ST3232
Pin(s)Desig.DestDesig.
1, 3 C1+ / C1- Connected via 0.1uF cap
2 V+ Connected to GND via 0.1uF cap
4, 5 C2+ / C2- connected via 0.1uF cap
6 V- Connected to GND via 0.1uF cap
7 T2out tts/0 pin 3 tts/0 TD
8 R2in tts/0 pin 6 tts/0 RD
9 R2out JP1 pin 6 tts/0 RXD
10 T2in JP1 pin 4 tts/0 TXD
11 T1in JP1 pin 3 tts/1 TXD
12 R1out JP1 pin 5 tts/1 RXD
13 R1in tts/1 pin 6 tts/1 RD
14 T1out tts/1 pin 3 tts/1 TD
15 GND GND
16 Vcc Vcc, GND via 0.1uF cap
AttachmentSize
DB9 version layout mask (positive, right side up) as a 1200 DPI file.973.13 KB
DB9 (rotated) version layout mask (positive, right side up) as a 1200 DPI file.975.57 KB
RJ45 version layout mask (positive, right side up) as a 1200 DPI file.1.07 MB
Single-port RJ45 version layout mask (positive, right side up) as a 1200 DPI file.958.4 KB
AMP Micro-MaTch Miniature Connector System General Information374.61 KB
KEMET Capacitors data sheet780.96 KB
ST3232 data sheet86.79 KB

Comments

I'm wanting to build one of these for my router. I already have the MAX3233EEPP serial line driver. I chose this because I really don't like surface mount soldering.

I've seen many examples of serial port mods for the WRT54G and I like yours the best. It's a really nice, clean look.

Drop me a message on Hans@Liss.pp.se and we'll see if I can help you somehow.

/Hans