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.
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.
|Taiyo Yuden||TMK107BJ104KA-T||0.1uF10% 0603 25V X5R||100n||5||C1, C2, C5, C6, C7|
|Yageo||CC0603KRX5R6BB225||2.2uF 10% 0603 10V X5R||2.2u||2||C3, C4|
|Stackpole||RMCF0603FT820R||820R 1% 0603 0.1W||820||3||R1, R2, R3|
|Diodes Inc.||AP7313-33SAG-7||Linear Regulator 3.3V 0.15A||AP7313||1||U1|
|Female Header 0.1" 13x2 pins||CONN_13X2||1||J1|
|FCI||10090097-P094XLF||DB9 FML 90DEG||DB9||2||J3, J4||For J3. Use solder cup connector for J4.|
|Osram||LG L29K-G2J1-24-Z||LED Green 0603||GREEN||3||D1, D2, D3|
|TI||MAX3232IDR||RS232 Driver 3.3V||MAX3232||1||U2|
The original DigiKey order for Rev 0A is in the CAD File package
I tried two common uses to verify it worked correctly: as a console for the Raspberry Pi, and to connect to another microcontroler board.
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.
click for larger image
Raspian running an upgrade.
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
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.
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.
The design may be used however you wish as long as credit is given to me.
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.