Serial Interface for Raspberry Pi

3D View Photo of Board

For something to do I decided to make a 'real' serial port adapter for the Raspberry Pi. It is a small PCB that converts the 3.3V UART signals on the GPIO header to RS232 level and provides a DB9 connector.

It is based on the MAX3232 3.3VTTL to RS232 transceiver. The transceiver supports speeds of up to 250 kpbs, but lack of handshake lines may make for unreliable communications at high speed. For high speed operation a USB serial adapter is probably a better idea.

The connector is wired as a DTE port (same as a PC). If it is connected to a PC a crossover cable is required.

LEDs are supplied for Power, TX and RX data.

Design

The design is basically the reference MAX3232 circuit. Only 1 transmitter and one receiver are used. 3.3V power is supplied by a linear regulator from the Raspberry Pi 5V rail. The board is similar in width to the Raspberry Pi. Some tape may be needed on the bottom surface to prevent shorts to the electrolytic capacitor on the Pi. The schematic and layout were done using KiCAD. The CAD files package includes the schematic, board file, Gerbers, BOM, datasheets, etc.

Parts List

Mfg.P/NDesc.ValueQtyRef. Des.Notes
Taiyo YudenTMK107BJ104KA-T0.1uF10% 0603 25V X5R 100n5C1, C2, C5, C6, C7
YageoCC0603KRX5R6BB2252.2uF 10% 0603 10V X5R 2.2u2C3, C4
StackpoleRMCF0603FT820R820R 1% 0603 0.1W 8203R1, R2, R3
Diodes Inc.AP7313-33SAG-7Linear Regulator 3.3V 0.15A AP73131U1
Female Header 0.1" 13x2 pins CONN_13X21J1
FCI10090097-P094XLFDB9 FML 90DEG DB92J3, J4For J3. Use solder cup connector for J4.
OsramLG L29K-G2J1-24-ZLED Green 0603 GREEN3D1, D2, D3
TIMAX3232IDRRS232 Driver 3.3V MAX32321U2

The original DigiKey order for Rev 0A is in the CAD File package

Testing

I tried two common uses to verify it worked correctly: as a console for the Raspberry Pi, and to connect to another microcontroler board.

Console

A cross over cable was connected between the adapter and a PC running Hyperterminal. The settings were 115200, 8n1, no handshake. Everything worked as expected.

RasPi Console
click for larger image
Raspian running an upgrade.

Microcontroller Access

To test accessing another device I connected an MC68HC11 board I had lying around and accessed its built in assembly monitor.

First you have to edit inittab to disable the console running on that port as described at the Raspberry Pi Wiki.

Then a program like cu can be used to access the port:
cu -l ttyAMA0 -s 9600

messy workbench
click for a larger image
The MC68HC11 is on the left, the Raspberry Pi is on the right. The TV is being used as I didn't have an HDMI monitor at the bench. Excuse the messy workbench.

MC68HC11 terminal
Here is the MC68HC11 monitor stepping through a simple program. Putty was used to SSH into the Raspberry Pi and cu to connect to the serial port.

Downloads

The design may be used however you wish as long as credit is given to me.

Schematic: Schematic.pdf
Assembly Drawing: Assy_Dwg.pdf
CAD Files: RasPi_Serial_Rev0B.zip
CAD Files includes: schematic, PCB layout, symbol and footprint libraries for created parts, Gerbers, Datasheets, etc.

Revisions

Rev 0A
Has a layout error requiring TX and RX to be swapped at the GPIO connector. The TX and RX LEDS are normally on.
Rev 0B
Fixed bugs from Rev 0A. Changed GPIO connector to more common style and removed the GPIO passthrough.