RS232 Level Shifting

Started by Scott Lingerfelt July 30, 2005
I need a solution that allows me to communicate with a modem that has
max 3.3Volt interface and my PIC must run at 5Volt due to other
interfacing.

I have been looking at using the MAX3243 to handle the shifting from the
PIC at 5V to 3V then from the modem at 3V to 5V. The only reason I do
not want to use this chip is I only need 1 TX and 1 RX line and the
MAX3243 has 2 TX and 5 RX pins.

Can I use a 2n2222 with the base connected to my PIC UART pin through a
1K ohm resistor, then the collector connected to my modem pin and
through a 1K ohm resistor connected to 3.3V, and the emittor will
connect to ground? I have never tested and would like to know if the
switching will be fast enough for say 9600 baud?

Will the PIC UART pin handle the 3.3V logic directly from the TX of my
modem?

Thanks for any help,
Scott


You will need to set your pic up for the inverted signals.
Jim
----- Original Message -----
From: Scott Lingerfelt
To: p...@yahoogroups.com
Sent: Saturday, July 30, 2005 8:20 AM
Subject: [piclist] RS232 Level Shifting

I need a solution that allows me to communicate with a modem that has
max 3.3Volt interface and my PIC must run at 5Volt due to other
interfacing.

I have been looking at using the MAX3243 to handle the shifting from the
PIC at 5V to 3V then from the modem at 3V to 5V.  The only reason I do
not want to use this chip is I only need 1 TX and 1 RX line and the
MAX3243 has 2 TX and 5 RX pins.

Can I use a 2n2222 with the base connected to my PIC UART pin through a
1K ohm resistor, then the collector connected to my modem pin and
through a 1K ohm resistor connected to 3.3V, and the emittor will
connect to ground?  I have never tested and would like to know if the
switching will be fast enough for say 9600 baud?

Will the PIC UART pin handle the 3.3V logic directly from the TX of my
modem?

Thanks for any help,
Scott



Hi Jim,

Inverted with the 2n2222?

I believe the pic can handle the 3.3V from my modem without adding any
components. Do you have any input on this?

Thanks for your input,
Scott JCullins wrote:

> You will need to set your pic up for the inverted signals.
> Jim
>
> ----- Original Message -----
> *From:* Scott Lingerfelt <mailto:slingerfelt@slin...>
> *To:* piclist@picl... <mailto:piclist@picl...>
> *Sent:* Saturday, July 30, 2005 8:20 AM
> *Subject:* [piclist] RS232 Level Shifting
>
> I need a solution that allows me to communicate with a modem that has
> max 3.3Volt interface and my PIC must run at 5Volt due to other
> interfacing.
>
> I have been looking at using the MAX3243 to handle the shifting
> from the
> PIC at 5V to 3V then from the modem at 3V to 5V. The only reason
> I do
> not want to use this chip is I only need 1 TX and 1 RX line and the
> MAX3243 has 2 TX and 5 RX pins.
>
> Can I use a 2n2222 with the base connected to my PIC UART pin
> through a
> 1K ohm resistor, then the collector connected to my modem pin and
> through a 1K ohm resistor connected to 3.3V, and the emittor will
> connect to ground? I have never tested and would like to know if the
> switching will be fast enough for say 9600 baud?
>
> Will the PIC UART pin handle the 3.3V logic directly from the TX
> of my
> modem?
>
> Thanks for any help,
> Scott >
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions >
> >. >
>No virus found in this incoming message.
>Checked by AVG Anti-Virus.
>Version: 7.0.338 / Virus Database: 267.9.7/60 - Release Date: 7/28/2005




What I meant is you will need to change the code to be compatible with the
fact that the signal will be inverted by the transistor.
 
I would add the second transistor to make sure you get a good level in to the Pic and to keep both input and outputs inverted.
Jim
----- Original Message -----
From: Scott Lingerfelt
To: p...@yahoogroups.com
Sent: Saturday, July 30, 2005 8:50 AM
Subject: Re: [piclist] RS232 Level Shifting

Hi Jim,

Inverted with the 2n2222? 

I believe the pic can handle the 3.3V from my modem without adding any
components.  Do you have any input on this?

Thanks for your input,
ScottJCullins wrote:

> You will need to set your pic up for the inverted signals.
> Jim
>
>     ----- Original Message -----
>     *From:* Scott Lingerfelt <mailto:s...@covcable.com>
>     *To:* p...@yahoogroups.com <mailto:p...@yahoogroups.com>
>     *Sent:* Saturday, July 30, 2005 8:20 AM
>     *Subject:* [piclist] RS232 Level Shifting
>
>     I need a solution that allows me to communicate with a modem that has
>     max 3.3Volt interface and my PIC must run at 5Volt due to other
>     interfacing.
>
>     I have been looking at using the MAX3243 to handle the shifting
>     from the
>     PIC at 5V to 3V then from the modem at 3V to 5V.  The only reason
>     I do
>     not want to use this chip is I only need 1 TX and 1 RX line and the
>     MAX3243 has 2 TX and 5 RX pins.
>
>     Can I use a 2n2222 with the base connected to my PIC UART pin
>     through a
>     1K ohm resistor, then the collector connected to my modem pin and
>     through a 1K ohm resistor connected to 3.3V, and the emittor will
>     connect to ground?  I have never tested and would like to know if the
>     switching will be fast enough for say 9600 baud?
>
>     Will the PIC UART pin handle the 3.3V logic directly from the TX
>     of my
>     modem?
>
>     Thanks for any help,
>     Scott>
>     to unsubscribe, go to http://www.yahoogroups.com and follow the
>     instructions>    
>     >.>    >
>No virus found in this incoming message.
>Checked by AVG Anti-Virus.
>Version: 7.0.338 / Virus Database: 267.9.7/60 - Release Date: 7/28/2005
>   


Correct!

I will add the second transistor it cannot hurt!

Thanks for the speedy response,
Scott

JCullins wrote:

> What I meant is you will need to change the code to be compatible with
> the
> fact that the signal will be inverted by the transistor.
>
> I would add the second transistor to make sure you get a good level in
> to the Pic and to keep both input and outputs inverted.
> Jim
>
> ----- Original Message -----
> *From:* Scott Lingerfelt <mailto:slingerfelt@slin...>
> *To:* piclist@picl... <mailto:piclist@picl...>
> *Sent:* Saturday, July 30, 2005 8:50 AM
> *Subject:* Re: [piclist] RS232 Level Shifting
>
> Hi Jim,
>
> Inverted with the 2n2222?
>
> I believe the pic can handle the 3.3V from my modem without adding
> any
> components. Do you have any input on this?
>
> Thanks for your input,
> Scott > JCullins wrote:
>
> > You will need to set your pic up for the inverted signals.
> > Jim
> >
> > ----- Original Message -----
> > *From:* Scott Lingerfelt <mailto:slingerfelt@slin...>
> > *To:* piclist@picl... <mailto:piclist@picl...>
> > *Sent:* Saturday, July 30, 2005 8:20 AM
> > *Subject:* [piclist] RS232 Level Shifting
> >
> > I need a solution that allows me to communicate with a modem
> that has
> > max 3.3Volt interface and my PIC must run at 5Volt due to other
> > interfacing.
> >
> > I have been looking at using the MAX3243 to handle the shifting
> > from the
> > PIC at 5V to 3V then from the modem at 3V to 5V. The only
> reason
> > I do
> > not want to use this chip is I only need 1 TX and 1 RX line
> and the
> > MAX3243 has 2 TX and 5 RX pins.
> >
> > Can I use a 2n2222 with the base connected to my PIC UART pin
> > through a
> > 1K ohm resistor, then the collector connected to my modem
> pin and
> > through a 1K ohm resistor connected to 3.3V, and the emittor
> will
> > connect to ground? I have never tested and would like to
> know if the
> > switching will be fast enough for say 9600 baud?
> >
> > Will the PIC UART pin handle the 3.3V logic directly from the TX
> > of my
> > modem?
> >
> > Thanks for any help,
> > Scott
> >
> >
> >
> > to unsubscribe, go to http://www.yahoogroups.com and follow the
> > instructions
> >
> >
> >
>
> > >.
> >
> >
> >
>
> >
> >
> >
> >No virus found in this incoming message.
> >Checked by AVG Anti-Virus.
> >Version: 7.0.338 / Virus Database: 267.9.7/60 - Release Date:
> 7/28/2005
> >
> >
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions >
> >. >
>No virus found in this incoming message.
>Checked by AVG Anti-Virus.
>Version: 7.0.338 / Virus Database: 267.9.7/60 - Release Date: 7/28/2005




--- In piclist@picl..., Scott Lingerfelt <slingerfelt@c...>
wrote:
> I need a solution that allows me to communicate with a modem that
has
> max 3.3Volt interface and my PIC must run at 5Volt due to other
> interfacing.
>
> I have been looking at using the MAX3243 to handle the shifting
from the
> PIC at 5V to 3V then from the modem at 3V to 5V. The only reason I
do
> not want to use this chip is I only need 1 TX and 1 RX line and the
> MAX3243 has 2 TX and 5 RX pins.


This problem should be easy, an open colector from the 3 to 5 V
interface and one resistor from 5 to 3V interface. However, I've
work recently with a nice chip, it's bidirectional but doesn't count
that: MAX3372. Better for you MAX3375. Very nice in SOT23-8 package.

cheers,
Vasile



Hi Scott,

The PIC will understand the 3.3V no problem, as for the modem, if your
PIC is outputing 5V, simply use a voltage divider to notch down to 3.3V.
I've used this with GSM modems that have CMOS-level UARTS (2.8V) and it
works just fine. Two resistors is all it takes :)

Regards,

Mike Scott Lingerfelt wrote:
> I need a solution that allows me to communicate with a modem that has
> max 3.3Volt interface and my PIC must run at 5Volt due to other
> interfacing.
>
> I have been looking at using the MAX3243 to handle the shifting from the
> PIC at 5V to 3V then from the modem at 3V to 5V. The only reason I do
> not want to use this chip is I only need 1 TX and 1 RX line and the
> MAX3243 has 2 TX and 5 RX pins.
>
> Can I use a 2n2222 with the base connected to my PIC UART pin through a
> 1K ohm resistor, then the collector connected to my modem pin and
> through a 1K ohm resistor connected to 3.3V, and the emittor will
> connect to ground? I have never tested and would like to know if the
> switching will be fast enough for say 9600 baud?
>
> Will the PIC UART pin handle the 3.3V logic directly from the TX of my
> modem?
>
> Thanks for any help,
> Scott >
>
> to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
> Yahoo! Groups Links