RS232

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
Post Reply
User avatar
Sambuchi
Posts: 366
Joined: Tue Jan 18, 2005 1:01 am
Location: Orlando FL
Contact:

RS232

Post by Sambuchi » Fri Jan 02, 2009 4:54 am

This might be a silly question... but does Maxim or any other IC company make a RS232 solution that can receive 5V logic and output 3.3V logic? I see Maxium has a wide variety of IC's that can run on 5V to 3.3V source, but how about the logic?

I would like to make a box that would interface to a computer but the micro that I'm using runs on 3.3V and I think most PC's use 5V logic.

Thanks
Tony

User avatar
Sambuchi
Posts: 366
Joined: Tue Jan 18, 2005 1:01 am
Location: Orlando FL
Contact:

Post by Sambuchi » Fri Jan 02, 2009 5:49 am

Hmmm... I'm reading about a Schmidt trigger IC.

This sounds interesting and could do it for me.

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Fri Jan 02, 2009 9:03 am

Hi Sam,


Are you saying you want to go from a
0v to 5v input to a 0v to 3.3v output

OR, are you saying you want to go from a
-5v to +5v input to a 0v to 3.3v output

?

I am asking because there are several solutions.

Would be good to know what the max baud rate will be too.
LEDs vs Bulbs, LEDs are winning.

User avatar
Sambuchi
Posts: 366
Joined: Tue Jan 18, 2005 1:01 am
Location: Orlando FL
Contact:

Post by Sambuchi » Fri Jan 02, 2009 9:07 am

Hello Al,

Looking at -5v to +5v input to a 0v to 3.3v output and back.

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Fri Jan 02, 2009 9:19 am

Hi again,


What is your fastest data rate?
LEDs vs Bulbs, LEDs are winning.

User avatar
Sambuchi
Posts: 366
Joined: Tue Jan 18, 2005 1:01 am
Location: Orlando FL
Contact:

Post by Sambuchi » Fri Jan 02, 2009 9:20 am

9600. nothing fast. This can be adjustable.

User avatar
Sambuchi
Posts: 366
Joined: Tue Jan 18, 2005 1:01 am
Location: Orlando FL
Contact:

Post by Sambuchi » Fri Jan 02, 2009 10:16 am

This looks interesting...

http://picprojects.org.uk/projects/simpleSIO/ssio.htm

But it gets the negative supply for the RS232 transmit data [from the micro] from the serial RS232 receive data line[from the PC]. I am guessing for this to work the PC needs to transmit while it receives for this to work?

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Fri Jan 02, 2009 11:04 am

Hi again,


One thing that you might note is that most modern computers can
take a 0 to 5v signal and even a 0 to 3v signal on the RS232 line.
Since you need transmit too, you'd have to clamp the PC output
to ground through a resistor to feed the uC, but that would probably
work without any ic chips at all.

The other thing you might want to note is that some electrical isolation
is always a good idea when interfacing instruments to the PC computer.
This is usually done using an opto isolator chip. This provides
extra electrical isolation between your circuit and your computer in
case something else goes wrong. It helps protect the computer.
For 9600 baud there are low cost opto's out there too.

As far as your original intent, Maxim does make several chips that
work with RS232 and 3.3v, too many to mention here, but one of
them is the MAX13236. I think that may work with both 5 and 3.3v
systems, but you should check the Maxim site to make sure and of
course to get the data sheet(s).

When you need to get a low current voltage from the port itself
it helps to have control over the protocol, keeping either the RTS
or the DTR lines either always low or always high, but you can also
check the default values if there are any. Another thing you can
do is actually measure these outputs with a meter or better a scope
to see if they stay (by default) at any particular level.
When you have control you can force them either way and get some
low current voltage for use for powering something that doesnt take
too much current. You'll have to look into this a bit more.
If i rem right the RTS line is -10v by default and the DTR is +10v.
LEDs vs Bulbs, LEDs are winning.

psycho
Posts: 388
Joined: Thu Jan 10, 2008 8:13 pm
Location: Northwest Indiana
Contact:

Post by psycho » Fri Jan 02, 2009 1:55 pm

Sorry about the late comment... The PIC, as a general rule, use Vcc as the logic levels. Now, if you look at the datasheet of the 232 translator, check what the hi (1) level would be. I believe for a 5v pic, it is 2.8v.

Now, some (all?) pics have internal Zeners - I know this because I saw an appnote where 120v is fed into an input pin (w/ a 1M resistor).

Therefore, if the particular PIC has Zeners, you can use 5v input signals. If the threshold for logic 1 on the RS232 chip will work with 3.3, you are all set.

Note that I did not try this. I did look in the MAX232 datasheet and I believe it's logic 1 is 2v. so, you can try it if you want.

Also, I have a Pickit 2, which is a programmer/debugger. It has an 18F2550 in it, which is a 5v part. It can be used to program/debug 3v parts (without a translator).

User avatar
MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

Post by MrAl » Fri Jan 02, 2009 7:08 pm

Hi psycho,


Working from memory here, i think some Pics have zeners and
most dont, so you have to check the data sheet carefully to make sure.

Most of them have clamping diodes that clamp the input to +Vcc,
so that is another way to achieve the desired voltage limit, with
an appropriate input resistor of course to limit clamp current.
There is one PIC app note that uses this method.
LEDs vs Bulbs, LEDs are winning.

Bigglez
Posts: 1282
Joined: Mon Oct 15, 2007 7:39 pm
Contact:

Re: RS232

Post by Bigglez » Fri Jan 02, 2009 11:27 pm

Sambuchi wrote:I would like to make a box that would interface to a computer but the micro that I'm using runs on 3.3V and I think most PC's use 5V logic.
A fully compliant RS-232 signal requires both positive
and negative signals with respect to system ground.

For a receiver using only 3.3 or 5V local power you
can easily truncate the received signal.

Transmitting data from a 3.3 or 5V local power
system is harder, and typically uses a switched-capacitor
boost to get enough amplitude and also negative
swings.

Many RS-232 interfaces cheat and only respond to or
generate 5V amplitude signals.

Do you need full compliance?

User avatar
Sambuchi
Posts: 366
Joined: Tue Jan 18, 2005 1:01 am
Location: Orlando FL
Contact:

Post by Sambuchi » Mon Jan 05, 2009 4:27 am

Do you need full compliance?l
Sure! I would like this box to work on any computer.
Wikipedia wrote:Voltage levels-
The RS-232 standard defines the voltage levels that correspond to logical one and logical zero levels. Valid signals are plus or minus 3 to 15 volts. The range near zero volts is not a valid RS-232 level
With that said, I would like to match the "standard" the best as I can.

That is great info about the PICs.
I will verify what my PIC is capable of doing.

I am wondering if the easiest way to do this is to get a 5V Maxim part that could handle 3.3V logic input from my Micro so it can transmit to the CPU with 5V logic. Then receiving from the CPU would have to be regulated from the Maxim part. Bump 0 to 5 to 0 to 3.3

This also might be the same thing you where suggesting Bigglez.
For a receiver using only 3.3 or 5V local power you can easily truncate the received signal. l

dyarker
Posts: 1749
Joined: Fri Aug 22, 2003 1:01 am
Location: Izmir, Turkiye; from Rochester, NY
Contact:

Post by dyarker » Mon Jan 05, 2009 5:18 am

A PC's RS-232 port may respond to 0V and 5V, but don't forget that the RS-232 signal in inverted from logic side signal.

Cheers,
Dale Y

Post Reply

Who is online

Users browsing this forum: No registered users and 49 guests