Searching \ for '[PIC] Serial pins to MAX232' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=serial
Search entire site for: 'Serial pins to MAX232'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Serial pins to MAX232'
2005\10\06@072847 by Mark Chauvin

picon face
I've got a design that someone else gave me, for a PIC16C58B.  It has the
rs232 serial lines from the db9 connector coming in PIC pins 1 & 2.
Transmit from the DB9 goes thru a 33k ohm resistor to PIC pin 1, and DB9
receive is tied directly to PIC pin 2.  DB9 pin 5 is tied to ground.  Comm
is 19200 baud, no handshaking (3 wires only).  I'd like to add a max232 chip
to the design.  I've got a max232 chip wired up to it, but can't get it to
work.  The guy that sells me the (pre-programmed) PIC's says the PIC serial
pins "are of oppposite logic levels" so the max232 won't work with it.  I've
got the chip wired up similar to what's shown here:

http://www.boondog.com/tutorials/pic16F84/rs232x.gif

except I have C9 tied to gnd, not VCC.  What am I doing wrong, or will this
even work without modding the PIC itself?

Thanks
-Mark


2005\10\06@080136 by Mchipguru

picon face
a MAX232 will do a logic inversion. You either need to use another inverter between the PIC and the MAX232 or change the pic code to invert the signals.
Larry G Nelson Sr.

{Quote hidden}

> --

2005\10\06@080312 by Lee Jones

flavicon
face
> I've got a design that someone else gave me, for a PIC16C58B.  It has
> the rs232 serial lines from the db9 connector coming in PIC pins 1 & 2.
> Transmit from the DB9 goes thru a 33k ohm resistor to PIC pin 1, and DB9
> receive is tied directly to PIC pin 2.  DB9 pin 5 is tied to ground.  Comm
> is 19200 baud, no handshaking (3 wires only).  I'd like to add a max232
> chip to the design.

Good.  Actually adhering to relevant standards (EIA/TIA-232 signaling
levels) is an excellant idea.

> I've got a max232 chip wired up to it, but can't get it to work.  The
> guy that sells me the (pre-programmed) PIC's says the PIC serial pins
> "are of oppposite logic levels" so the max232 won't work with it.

Essentially, you can think of the EIA-232 driver chip as providing
one signal inversion per pin.  Given the non-compliant way the PIC
was connected, the original design must do the inversion in software.

To continue using the PIC software unmodified, you need to insert a
logic level inverter on each of the TxD and RxD lines between the PIC
pin and the MAX232 pin.  74HCT04 or 74LS04 hex inverter would work.

> I've got the chip wired up similar to what's shown here:
>
> www.boondog.com/tutorials/pic16F84/rs232x.gif
>
> except I have C9 tied to gnd, not VCC.  What am I doing wrong, or will
> this even work without modding the PIC itself?

I believe you need to tie C9 to Vcc as shown.  It's part of
the voltage doubler/inverter system.

                                               Lee Jones

2005\10\06@080648 by Jinx

face picon face
> What am I doing wrong

Comparing your gif with a couple of circuits I have here using
the MAX232, it appears to me that you should swap pins 2
and 3 on the DB9

There've been several discussions about RS232 levels and
compatibility with PICs. ISTR that for best fit a MAX232
should be used. Simpler interfaces can be used but aren't
guaranteed to work in every situation

2005\10\06@081107 by Jinx

face picon face
> a MAX232 will do a logic inversion. You either need to use
> another inverter between the PIC and the MAX232 or change
> the pic code to invert the signals

I've never used an inverter + MAX232. All the RS232 I've
ever worked with has been negative logic

2005\10\06@092343 by Mchipguru

picon face
Some stuff I worked on used a pic directly without buffer so it needed the logic inverted in the code. It sounds like this is the case here. You can often get away with this but the signals are 0 to 5 VDC and non compliant but often works. This is especially true on the desk or bench but when you get to volume you will usually get into trouble. There is a reason for the +/- swings used.
Larry

>
> From: Jinx <joecolquittspamKILLspamclear.net.nz>
> Date: 2005/10/06 Thu AM 08:11:03 EDT
> To: "Microcontroller discussion list - Public." <.....piclistKILLspamspam.....mit.edu>
> Subject: Re: [PIC] Serial pins to MAX232
>
> > a MAX232 will do a logic inversion. You either need to use
> > another inverter between the PIC and the MAX232 or change
> > the pic code to invert the signals
>
> I've never used an inverter + MAX232. All the RS232 I've
> ever worked with has been negative logic
>
> --

2005\10\06@092930 by Alan B. Pearce

face picon face
>I've never used an inverter + MAX232. All the
>RS232 I've ever worked with has been negative logic

Yeah, but it sounds like the unit he is working with uses a software UART,
as the pin numbers he is calling out are not the usual ones for a hardware
uart.

2005\10\06@093154 by Mark Chauvin

picon face
Thanks for the help everyone.  I'll see if I can get
the chip without the inverted-pin code, or I'll check
out the hex inverters mentioned.

> I believe you need to tie C9 to Vcc as shown.  It's
> part of
> the voltage doubler/inverter system.

I tried it both ways.  The data sheet for the max232
actually shows it tied to ground, but there's a
footnote that it can also be tied to VCC.

-Mark

2005\10\06@094442 by Jan-Erik Soderholm

face picon face
Mark Chauvin wrote :

> I tried it both ways.  The data sheet for the max232
> actually shows it tied to ground, but there's a
> footnote that it can also be tied to VCC.

Note that the cap is "just" used to store a specific
voltage level. As long as the voltage limit of the
cap isn't violated, it doesn't matter that much which
voltage level the *other* side of the cap is connected
to.

I *might* have some things to do with the startup
current of the voltage multiplier and so on, thought...

I'd *guess* that the recomendation is such so that
you get the lowest voltage over the cap during
normal use (the +15 V cap is connected to 5V and
the -15V cap is connected to GND). That would give
you the best lifetime and you can use a cap with
slightly lower voltage spec (= smaller and lower price).

But, the point is, that it will probably (under normal
conditions) work (or not work) but ways.

Jan-Erik.



More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...