User avatar
clickykbd
Posts: 117
Joined: Wed Jun 06, 2012 2:21 am
Location: Austin, Texas
Contact: Website

Re: Help with RS232 GPIO connection

Mon Jul 16, 2012 9:57 pm

Hi

I've successfully got serial-console working via techniques similar to many posted here via the mini-UART gpio . But what I want to know is if this same technique is valid for RS232/serial devices such as printers/plotters etc. For example I am using a python library that expects true com style ports, and works with usb serial adapters, but doesn't natively recognize any other serial interfaces on the Pi. I'm curious if it can be done natively with the GPIO?

Is anyone else working on similar? Any success?

User avatar
el_toro
Posts: 12
Joined: Sat Jun 30, 2012 10:26 pm

Re: Help with RS232 GPIO connection

Tue Jul 17, 2012 8:31 pm

dbodnar wrote:Good day - I would like to offer another suggestion for an inexpensive way to connect the Pi's UART to a standard serial port.
.
.

dave
Dave - thanks; I have ordered a few to try them, although this seems to be pretty much the same thing, just with a DB9F soldered on already and some activity LEDs
MAX3232_eBay_board.jpg
Board from eBay
MAX3232_eBay_board.jpg (16.8 KiB) Viewed 3143 times
Ed

kghunt
Posts: 383
Joined: Sun Mar 04, 2012 9:28 am

Re: Help with RS232 GPIO connection

Wed Jul 18, 2012 10:36 am

I bought one of these too.

kghunt
Posts: 383
Joined: Sun Mar 04, 2012 9:28 am

Re: Help with RS232 GPIO connection

Thu Jul 19, 2012 9:07 am

dbodnar wrote:Good day - I would like to offer another suggestion for an inexpensive way to connect the Pi's UART to a standard serial port.

I found a single board with the MAX3232 chip and the 5 capacitors already mounted - all are surface mount components and the price is quite attractive.

Have a look at the description of what I used on my web page here:

http://www.trainelectronics.com/RaspberryPi/

Please let me know if you have any questions.

thanks!

dave
I bought one of these and your pictures do not do its size justice. It is bloody tiny!

Image

I put one of my readers and the chip onto a business card for scale.

I have a question though. If I want to power the device on the other side from 5v will that affect the signal going to the pi?

Also if I want to power the reader from 3.3v can I do it through the chip?

p.s. sorry about blurry cam my S2 went for a swim so Im borrowing a Galaxy mini II while its off for repair.

kghunt
Posts: 383
Joined: Sun Mar 04, 2012 9:28 am

Re: Help with RS232 GPIO connection

Thu Jul 19, 2012 4:29 pm

Broke my chip :-(.

Whilst soldering the little bugger I leant on a wire I had already soldered on and pulled it off solder pad and all. Now I have nowhere to solder to.

ksangeelee
Posts: 192
Joined: Sun Dec 25, 2011 5:25 pm
Location: Edinburgh, UK
Contact: Website

Re: Help with RS232 GPIO connection

Thu Jul 19, 2012 4:47 pm

kghunt wrote:Broke my chip :-(.
Whilst soldering the little bugger I leant on a wire I had already soldered on and pulled it off solder pad and all. Now I have nowhere to solder to.

Some suggestions...

1. Get a magnifier.
2. Check the pad's underside - it could be that the track runs from the bottom pad.
3. Try to scratch off some solder-resist from the board to expose the copper.
4. Look for vias, chip-pins or other exposed points that this pad connects to (continuity meter).
5. When you get the wire on, use some hot-melt glue to keep it secure.
.

dbodnar
Posts: 6
Joined: Mon Jul 16, 2012 10:10 am
Location: Pittsburgh, PA
Contact: Website

Re: Help with RS232 GPIO connection

Sun Jul 29, 2012 9:32 pm

kghunt wrote:
dbodnar wrote:Good day - I would like to offer another suggestion for an inexpensive way to connect the Pi's UART to a standard serial port.

I found a single board with the MAX3232 chip and the 5 capacitors already mounted - all are surface mount components and the price is quite attractive.

Have a look at the description of what I used on my web page here:

http://www.trainelectronics.com/RaspberryPi/

Please let me know if you have any questions.

thanks!

dave
I bought one of these and your pictures do not do its size justice. It is bloody tiny!

Image

I put one of my readers and the chip onto a business card for scale.

I have a question though. If I want to power the device on the other side from 5v will that affect the signal going to the pi?

Also if I want to power the reader from 3.3v can I do it through the chip?

p.s. sorry about blurry cam my S2 went for a swim so Im borrowing a Galaxy mini II while its off for repair.

I have been powering the web cam switcher board with the 5 volt line from the Pi for a number of days without any problem with communications. Not sure about using the 3.3 volts.

I agree about the size - I have added a photo to my notes with the device sitting on, and nearly covering, a US penny.

dave

dave

dbodnar
Posts: 6
Joined: Mon Jul 16, 2012 10:10 am
Location: Pittsburgh, PA
Contact: Website

Re: Help with RS232 GPIO connection

Sun Jul 29, 2012 9:35 pm

kghunt wrote:Broke my chip :-(.

Whilst soldering the little bugger I leant on a wire I had already soldered on and pulled it off solder pad and all. Now I have nowhere to solder to.
I had the same problem with one of my devices and managed to solder directly to the IC to save the board. Just follow the lead from the bad pad and see if you can determine where it goes.

dave

ferrymanr
Posts: 61
Joined: Fri Mar 16, 2012 11:09 pm

Re: Help with RS232 GPIO connection

Mon Jul 30, 2012 11:45 pm

I have tried a range of USB to RS-232 converters on my RPi but have not had any success through a powered hub and many errors when plugged directly into an Rpi USB port when I am using a sound device plugged ito the other USB port or if I am using a high network loading. To overcome this I was looking at using the serial ports available on board on the GPIO. As my external device ultimately needs TTL level with RS-232 protocols all I will need is a 3.3V to 5V level converter. However I am not clear about how to use this port. Do I just point my software to /dev/ttyAMA0 instead of /dev/ttyUSB0 or do I need to set up anything else? Are there any limitations?
Thanks.

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

Re: Help with RS232 GPIO connection

Tue Jul 31, 2012 12:09 am

ferrymanr wrote:I have tried a range of USB to RS-232 converters on my RPi but have not had any success through a powered hub and many errors when plugged directly into an Rpi USB port when I am using a sound device plugged ito the other USB port or if I am using a high network loading. To overcome this I was looking at using the serial ports available on board on the GPIO. As my external device ultimately needs TTL level with RS-232 protocols all I will need is a 3.3V to 5V level converter. However I am not clear about how to use this port. Do I just point my software to /dev/ttyAMA0 instead of /dev/ttyUSB0 or do I need to set up anything else? Are there any limitations?
Thanks.
Its very unlikely that any 5V logic device won't work with 3V3 levels, almost all see anything above 2.0 Volt as an acceptable logic high.
If you have a 5V logic, and want to convert it to 3V3, simply use a 2K2 to the GPIO, and from that a 3k3 resistor to ground, that will neatly convert 5V levels to 3V3 levels, works great with 5V RS232 convertors.

ferrymanr
Posts: 61
Joined: Fri Mar 16, 2012 11:09 pm

Re: Help with RS232 GPIO connection

Tue Jul 31, 2012 10:50 pm

I have this uart working well now. I had to comment out the line in /etc/inittab that spawned a getty on /dev/ttyAMA0 otherwise I could not access it. Using this port overcomes all the problems I had using USB to serial devices, no missed interrupts, does not upset the USB audio device and does not make the keyboard go into repeat mode. (similar to what happens with low supply voltage). Pity the other UART is not so easy to use.

Return to “Interfacing (DSI, CSI, I2C, etc.)”