User avatar
TonyD
Posts: 445
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: RS232 Breakout Board

Mon Jan 23, 2012 10:14 pm

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

Tony

User avatar
Frank Buss
Posts: 92
Joined: Fri Jan 06, 2012 4:39 pm
Contact: Website

Re: RS232 Breakout Board

Tue Jan 24, 2012 5:40 am

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.

User avatar
TonyD
Posts: 445
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: RS232 Breakout Board

Tue Jan 24, 2012 1:18 pm

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.
Tony

kasperl
Posts: 90
Joined: Fri Jan 06, 2012 6:20 pm

Re: RS232 Breakout Board

Tue Jan 24, 2012 1:51 pm

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.

User avatar
psergiu
Posts: 223
Joined: Mon Nov 07, 2011 8:36 am
Location: TX, U.S.A. (was: RO, E.U.)
Contact: Website

Re: RS232 Breakout Board

Tue Jan 24, 2012 1:58 pm

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

nelson
Posts: 38
Joined: Sat Dec 17, 2011 3:43 am

Re: RS232 Breakout Board

Tue Jan 24, 2012 1:59 pm

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

kasperl
Posts: 90
Joined: Fri Jan 06, 2012 6:20 pm

Re: RS232 Breakout Board

Tue Jan 24, 2012 2:28 pm

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.

User avatar
TonyD
Posts: 445
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: RS232 Breakout Board

Wed Jan 25, 2012 1:20 pm

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
Tony

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: RS232 Breakout Board

Wed Jan 25, 2012 1:49 pm

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.


greypower
Posts: 92
Joined: Sat Jan 07, 2012 10:00 am

Re: RS232 Breakout Board

Wed Jan 25, 2012 2:04 pm

@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.

User avatar
Gert van Loo
Posts: 2481
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: RS232 Breakout Board

Wed Jan 25, 2012 3:38 pm

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.

kasperl
Posts: 90
Joined: Fri Jan 06, 2012 6:20 pm

Re: RS232 Breakout Board

Wed Jan 25, 2012 5:04 pm

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?

User avatar
TonyD
Posts: 445
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: RS232 Breakout Board

Tue Feb 07, 2012 1:38 pm

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.

Tony

plugwash
Forum Moderator
Forum Moderator
Posts: 3347
Joined: Wed Dec 28, 2011 11:45 pm

Re: RS232 Breakout Board

Tue Feb 07, 2012 2:47 pm

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.

User avatar
walney
Posts: 233
Joined: Wed Nov 30, 2011 6:57 pm
Contact: Website

Re: RS232 Breakout Board

Wed Feb 08, 2012 10:37 am

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).

User avatar
Gert van Loo
Posts: 2481
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: RS232 Breakout Board

Wed Feb 08, 2012 11:52 am

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.)

User avatar
TonyD
Posts: 445
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: RS232 Breakout Board

Wed Feb 08, 2012 1:17 pm

Thanks for the info. Gert, I'll update the RS232 board to allow CTS/RTS to be used
Tony

User avatar
walney
Posts: 233
Joined: Wed Nov 30, 2011 6:57 pm
Contact: Website

Re: RS232 Breakout Board

Wed Feb 08, 2012 2:03 pm

Thanks to both of you for your prompt reply...

Looks very hopeful for my little project

User avatar
bob_binz
Posts: 441
Joined: Thu Feb 02, 2012 7:58 pm
Location: Stockport, UK

Re: RS232 Breakout Board

Thu Mar 08, 2012 2:16 pm

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

gregeric
Posts: 1508
Joined: Mon Nov 28, 2011 10:08 am

Re: RS232 Breakout Board

Thu Mar 08, 2012 4:56 pm

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.

User avatar
bob_binz
Posts: 441
Joined: Thu Feb 02, 2012 7:58 pm
Location: Stockport, UK

Re: RS232 Breakout Board

Thu Mar 08, 2012 8:41 pm

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

gregeric
Posts: 1508
Joined: Mon Nov 28, 2011 10:08 am

Re: RS232 Breakout Board

Fri Mar 09, 2012 10:20 am

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.

grahamed
Posts: 277
Joined: Mon Jan 30, 2012 7:01 pm

Re: RS232 Breakout Board

Fri Mar 09, 2012 6:35 pm

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.

cobrakai87
Posts: 1
Joined: Fri Mar 30, 2012 2:53 am

Re: RS232 Breakout Board

Fri Mar 30, 2012 3:01 am

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.

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 11672
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: RS232 Breakout Board

Fri Mar 30, 2012 7:24 am

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".

Return to “Other projects”