I would like to share a little RS232 breakout PCB I've designed for use with the RPi.
It's a simple RS232 circuit using a MAX3232 chip connected to the UART Rx and Tx of the RPi.
The design was done in DesignSpark PCB and I'll post the design files and gerbers in due course.
I've not included any mounting holes as I don't know if the final RPi will have any, although I hope to add some for the next version.
I expect to get some finished PCB's after the Chinese New Year
- Frank Buss
- Posts: 92
- Joined: Fri Jan 06, 2012 4:39 pm
- Contact: Website
Re: RS232 Breakout Board
Nice, and looks like you have a prototype area, too. Maybe you should add a 3.3 V voltage regulator, because the 3.3 V supply of the Raspberry Pi supplies just up to 50 mA. I've used the MCP1703 for my IO expander project, which provides up to 250 mA and has a short circuit protection. For the capacitors of the MAX3232 you don't need electrolytic capacitors, there are 1 uF ceramic capacitors in big SMD packages, like 1206, I think even easier to solder than trough hole. And if you add another rail on the prototype side for the 5 V, someone could even drive servos and the like with it.
Re: RS232 Breakout Board
Thanks Frank.
I take your point about adding a 3.3V reg especially if you want to use the prototyping area but RPi's 3.3V at 50mA is enough for the MAX3232 by itself. I'll add a 3.v3 reg like the MCP1703 for the prototyping area. What's the current rating for the RPi 5V supply?
True about 1206 and even 0603 surface mount packages being easy to solder but I've keeped this revision through hole as many new electronics hobbyists are put off by SMD packages.
I take your point about adding a 3.3V reg especially if you want to use the prototyping area but RPi's 3.3V at 50mA is enough for the MAX3232 by itself. I'll add a 3.v3 reg like the MCP1703 for the prototyping area. What's the current rating for the RPi 5V supply?
True about 1206 and even 0603 surface mount packages being easy to solder but I've keeped this revision through hole as many new electronics hobbyists are put off by SMD packages.
Tony
Re: RS232 Breakout Board
As someone who is rather new to electronics, any chance on just the schematic for going from UART to RS232? I know quite a few applications for serial connectors, especially when using the Pi to control lab equipment and the like. Having the rest of the GPIO free for other stuff would be very valuable.
And, on a slight tangent, how hard would it be to add more RS232 ports then just the one? Preferably using as little of the GPIO pins as possible, of course.
And, on a slight tangent, how hard would it be to add more RS232 ports then just the one? Preferably using as little of the GPIO pins as possible, of course.
- psergiu
- Posts: 224
- Joined: Mon Nov 07, 2011 8:36 am
- Location: TX, U.S.A. (was: RO, E.U.)
- Contact: Website
Re: RS232 Breakout Board
Kasperi - see what MAX232 compatible chip you can get your hands on and look in the datasheet at the examples - that's how i did all my converters - various vendors have various pinouts and capacitor requirements.
As for multiple UART/RS232 using GPIO, nope. See this thread:
http://www.raspberrypi.org/for.....ports-uart
As for multiple UART/RS232 using GPIO, nope. See this thread:
http://www.raspberrypi.org/for.....ports-uart
Re: RS232 Breakout Board
have found this for previous project, saved a lot of work but is expensive, maybe some ebay-fu will save some bucks
edit: fixed link
edit: fixed link
Re: RS232 Breakout Board
psergiu said:
Kasperi - see what MAX232 compatible chip you can get your hands on and look in the datasheet at the examples - that's how i did all my converters - various vendors have various pinouts and capacitor requirements.
As for multiple UART/RS232 using GPIO, nope. See this thread:
http://www.raspberrypi.org/for.....ports-uart
Thanks for the link, that looks useful for interfacing multiple devices. Timing over USB would probably still be quite good, I probably only need 250ms as maximum latency anyway.
Kasperi - see what MAX232 compatible chip you can get your hands on and look in the datasheet at the examples - that's how i did all my converters - various vendors have various pinouts and capacitor requirements.
As for multiple UART/RS232 using GPIO, nope. See this thread:
http://www.raspberrypi.org/for.....ports-uart
Thanks for the link, that looks useful for interfacing multiple devices. Timing over USB would probably still be quite good, I probably only need 250ms as maximum latency anyway.
Re: RS232 Breakout Board
Kasperl said:
As someone who is rather new to electronics, any chance on just the schematic for going from UART to RS232?
..
You can find my schematic here for the RS232 breakout board
As someone who is rather new to electronics, any chance on just the schematic for going from UART to RS232?
..
You can find my schematic here for the RS232 breakout board
Tony
Re: RS232 Breakout Board
A a much easier way to add RS232, using a USB port.
I have tested this one on Debian and it works no problem. The casing is rubber, so it can be stripped down to a tiny board if you wish. The RS232 interface does not drive the full voltage range, only 0-5V, but this should not be a problem with any hardware built in the last 20 years.
Only useful if you have a USB hub available, because USB ports are precious on the Rpi.
I have tested this one on Debian and it works no problem. The casing is rubber, so it can be stripped down to a tiny board if you wish. The RS232 interface does not drive the full voltage range, only 0-5V, but this should not be a problem with any hardware built in the last 20 years.
Only useful if you have a USB hub available, because USB ports are precious on the Rpi.
Re: RS232 Breakout Board
@Kasperl
As above, USB to serial is possible using things like:
http://www.ftdichip.com/Produc.....Cables.htm
also:
http://www.ebay.co.uk/itm/ws/e.....0726090709
which uses FTDI chip.
Drivers appear to be available for Windows CE on Arm - but I don't know if they will work on Pi - perhaps get in touch with FTDI direct if you're interested.
As above, USB to serial is possible using things like:
http://www.ftdichip.com/Produc.....Cables.htm
also:
http://www.ebay.co.uk/itm/ws/e.....0726090709
which uses FTDI chip.
Drivers appear to be available for Windows CE on Arm - but I don't know if they will work on Pi - perhaps get in touch with FTDI direct if you're interested.
- Gert van Loo
- Posts: 2487
- Joined: Tue Aug 02, 2011 7:27 am
- Contact: Website
Re: RS232 Breakout Board
You only need drivers if you plug the USB side in the Raspberry-Pi. If you connect the UART side to the Pi it will work fine. We use those cables on the Alpha and Beta boards all the time.
If you use the exact same FTDI cable the pin order is:
Black: goes to pin 6 of GPIO.
Yellow: goes to pin 8 of the GPIO
Orange: goes to pin 10 of the GPIO
Baud rate 115K, 8 data, 1 start, 1 stop, no parity.
If you use the exact same FTDI cable the pin order is:
Black: goes to pin 6 of GPIO.
Yellow: goes to pin 8 of the GPIO
Orange: goes to pin 10 of the GPIO
Baud rate 115K, 8 data, 1 start, 1 stop, no parity.
Re: RS232 Breakout Board
It's mainly connecting more RS232 devices to the same Pi, but a USB cable with drivers should do fine for that stuff. I assume the baudrate and such for the UART can be changed in software?
Re: RS232 Breakout Board
I found some time to finish of the design for the Raspbery Pi RS232 breakout board. I followed Frank's advice and added a 3.3V regulator to give more current to the 3.3V for the prototyping area.
Schematics are here.
Schematics are here.
Tony
Re: RS232 Breakout Board
I use a FT232 with my beagleboards (both original and XM) with no problems so i'm pretty sure it will work fine with a Pi, linux tends to have built in drivers for this sort of stuff.
Re: RS232 Breakout Board
I'm really interested in the prospect of an RS232 board. However, am I correct in assuming that this is a 3-wire solution (RX, TX, ground)? I noticed when I skimmed the Broadcom data sheet that RTS/CTS were available (at least from the SOC).
So (as a non-hardware bod) I have two questions:
1. is it possible to get hold of RTS/CTS for the serial port?
2. is it possible to fudge DTR using a GPIO pin?
Both are required for an existing application that would be nice to port. RTS/CTS is required because the application logic expects hardware rather than software handshaking (and it would be a mess to unravel it).
DTR is required because by dropping the line you can force the modem to break to a command prompt (so it's a much cleaner solution than passing the usual +++ break sequence).
So (as a non-hardware bod) I have two questions:
1. is it possible to get hold of RTS/CTS for the serial port?
2. is it possible to fudge DTR using a GPIO pin?
Both are required for an existing application that would be nice to port. RTS/CTS is required because the application logic expects hardware rather than software handshaking (and it would be a mess to unravel it).
DTR is required because by dropping the line you can force the modem to break to a command prompt (so it's a much cleaner solution than passing the usual +++ break sequence).
- Gert van Loo
- Posts: 2487
- Joined: Tue Aug 02, 2011 7:27 am
- Contact: Website
Re: RS232 Breakout Board
GPIO 16 & 17 are the CTS/RTS lines (Page 102). Yes you can take an arbitrary GPIO pin for DTR. The current Linux drives will set up GPIO 14 & 15 to be in UART mode. You have to do that yourself for the GPIO ports 16 & 17.
I am not even sure which UART the Linux drivers use as both the UART0 and UART1 come out on the same pins. (And no: that is not by accident. The idea was always to allow a user to switch between UARTs without having to swap pins.)
I am not even sure which UART the Linux drivers use as both the UART0 and UART1 come out on the same pins. (And no: that is not by accident. The idea was always to allow a user to switch between UARTs without having to swap pins.)
Re: RS232 Breakout Board
Thanks for the info. Gert, I'll update the RS232 board to allow CTS/RTS to be used
Tony
Re: RS232 Breakout Board
Thanks to both of you for your prompt reply...
Looks very hopeful for my little project
Looks very hopeful for my little project
Re: RS232 Breakout Board
Gert said:
GPIO 16 & 17 are the CTS/RTS lines (Page 102). Yes you can take an arbitrary GPIO pin for DTR. The current Linux drives will set up GPIO 14 & 15 to be in UART mode. You have to do that yourself for the GPIO ports 16 & 17.
Ok, sorry for being a bit thick here - what does Page 102 refer to? Also, is there an example for configuring GPIO 16 & 17
Thanks,
BBz
GPIO 16 & 17 are the CTS/RTS lines (Page 102). Yes you can take an arbitrary GPIO pin for DTR. The current Linux drives will set up GPIO 14 & 15 to be in UART mode. You have to do that yourself for the GPIO ports 16 & 17.
Ok, sorry for being a bit thick here - what does Page 102 refer to? Also, is there an example for configuring GPIO 16 & 17
Thanks,
BBz
Re: RS232 Breakout Board
Gert's talking about p102 of the BCM2835 ARM Peripherals datasheet. On consulting the RPi wiki I'm not sure GPIO16 is brought out to the header!? The wiki has example c code for setting up GPIO alt's.
Re: RS232 Breakout Board
Ahh, ok, thanks. I assume you mean this page: http://elinux.org/RPi_Low-leve.....eripherals ?? Yes, according to that, it seems IO16 is not connected to the header.
Thanks again
BBz
Thanks again
BBz
Re: RS232 Breakout Board
Yes, that"s the page. One can only hope that GPIO16 surfaces somewhere to allow modification by hand on the initial batch for those that need it, and that in future revs a way is found to route it to one of the spare header pins.
Re: RS232 Breakout Board
hi
Have a look at ebay.co.uk for CP2102. Less than £2 delivered . The £1.95 from Hong Kong has pins for 0V, RX, TX, 3V3 and 5V, and holes marked (but not tested by me) DCD, RI, RTS, CTS, DSR, DTR, SPD and Spd/. Others look similar.
Have a look at ebay.co.uk for CP2102. Less than £2 delivered . The £1.95 from Hong Kong has pins for 0V, RX, TX, 3V3 and 5V, and holes marked (but not tested by me) DCD, RI, RTS, CTS, DSR, DTR, SPD and Spd/. Others look similar.
-
- Posts: 1
- Joined: Fri Mar 30, 2012 2:53 am
Re: RS232 Breakout Board
Actually, the breakout board would be perfect for someone using the homemade temp sensor arrays found on the web, using the One-wire ds18b20 temp sensors.
- mahjongg
- Forum Moderator
- Posts: 13541
- Joined: Sun Mar 11, 2012 12:19 am
- Location: South Holland, The Netherlands
Re: RS232 Breakout Board
You are using the MAX3232 chip, because the SoC is a 3V3 device that doesn"t tolerate 5V levels, but the 5V version of the chip may be cheaper and more easy to source.
Note that an easy solution exist, with a simple resistor divider (2K2 top, 3K3 bottom) you can convert the 5V signal to 3V3 for the SoC, and the 3V3 level from the SoC is enough to drive the RS232 driver chip reliable (it needs 2,0V for "1"). Perhaps you can add these resistors to your design. A 0E resistor (wire) instead of the 2K2 resistor can be used when using a 3.3 volt transceiver.
Also, if you create a version that leaves out the breadboard area, you get a much smaller board that fits exactly on the area of the R-pi board without high components, you can then solder the smaller board directly to the R-pi""s pinheaders. That would also take care of the "mounting problem".
Because you repeated the existing pinheader the small board can be permanently affixed.
If you can also put a small I2C RTC IC on the board (8-pin versions do exist) it would make the R-pi a much more complete "PC alternative".
Note that an easy solution exist, with a simple resistor divider (2K2 top, 3K3 bottom) you can convert the 5V signal to 3V3 for the SoC, and the 3V3 level from the SoC is enough to drive the RS232 driver chip reliable (it needs 2,0V for "1"). Perhaps you can add these resistors to your design. A 0E resistor (wire) instead of the 2K2 resistor can be used when using a 3.3 volt transceiver.
Also, if you create a version that leaves out the breadboard area, you get a much smaller board that fits exactly on the area of the R-pi board without high components, you can then solder the smaller board directly to the R-pi""s pinheaders. That would also take care of the "mounting problem".
Because you repeated the existing pinheader the small board can be permanently affixed.
If you can also put a small I2C RTC IC on the board (8-pin versions do exist) it would make the R-pi a much more complete "PC alternative".