Page 1 of 1

RS232

Posted: Fri Jan 02, 2009 4:54 am
by Sambuchi
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

Posted: Fri Jan 02, 2009 5:49 am
by Sambuchi
Hmmm... I'm reading about a Schmidt trigger IC.

This sounds interesting and could do it for me.

Posted: Fri Jan 02, 2009 9:03 am
by MrAl
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.

Posted: Fri Jan 02, 2009 9:07 am
by Sambuchi
Hello Al,

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

Posted: Fri Jan 02, 2009 9:19 am
by MrAl
Hi again,


What is your fastest data rate?

Posted: Fri Jan 02, 2009 9:20 am
by Sambuchi
9600. nothing fast. This can be adjustable.

Posted: Fri Jan 02, 2009 10:16 am
by Sambuchi
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?

Posted: Fri Jan 02, 2009 11:04 am
by MrAl
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.

Posted: Fri Jan 02, 2009 1:55 pm
by psycho
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).

Posted: Fri Jan 02, 2009 7:08 pm
by MrAl
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.

Re: RS232

Posted: Fri Jan 02, 2009 11:27 pm
by Bigglez
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?

Posted: Mon Jan 05, 2009 4:27 am
by Sambuchi
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

Posted: Mon Jan 05, 2009 5:18 am
by dyarker
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,