I know this might have been asked before, but I was unable to find it in the list archive. What is they better way to setup a serial port? Lots of schematics use the MAX202 or MAX232 to transmit the serial data, while others just use a resistor on the RX and TX line. Is there any particular advantage to either way? The resistors would be easiest, since I could just run up to Radio Shack for those, but I don't know much about PICs or EE.
Thanks,
Ken
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
At 10:10 AM 1/22/01 -0800, you wrote:
>I know this might have been asked before, but I was unable to find it in
the list archive. What is they better way to setup a serial port? Lots of
schematics use the MAX202 or MAX232 to transmit the serial data, while
others just use a resistor on the RX and TX line. Is there any particular
advantage to either way? The resistors would be easiest, since I could just
run up to Radio Shack for those, but I don't know much about PICs or EE.
>
MAX-type chips - best approach, if rigorously meeting the specs is
important.
BJT-inverter type ckts - generally acceptable, but +V usually = 5v,
rather than +12v. Better ckts use a half-wave rectifier on the
Rxd line to develop/hold -12v.
Simple R ckts - very slap-dash [IMO], neg-voltages especially are
typically out-of-spec.
hope this helps,
- Dan Michaels
Oricom technologies http://www.oricomtech.com
=========================
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
> I know this might have been asked before, but I was unable to find it in the list archive. What is they better way to setup a serial port? Lots of schematics use the MAX202 or MAX232 to transmit the serial data, while others just use a resistor on the RX and TX line. Is there any particular advantage to either way? The resistors would be easiest, since I could just run up to Radio Shack for those, but I don't know much about PICs or EE.
Hi Ken,
At the most important level, using a MAX232 chip inverts the signal(1
becomes 0 and vice versa), whereas resistors do not.
If you are creating a "virtual uart"(bit-bashing to create the port) then
you can decide whether to invert or not, so either way can work.
If you are using a PIC with a built-in hardware UART, you do not have the
choice and must invert in hardware, either with a MAX232 type solution or
using transistors.
Using a MAX232 gives you strong signals and best compatibility. Using
resistors will work "most" of the time.
-Bob
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
Nuts, I was afraid I might have to order another component... I'm using the
16F877, so I would need to invert the signals. Do you know if any of the
MAX-* chips can recieve/handle the CTS or RTS signals? I need to read/set
those, so if it can handle them, then I wouldn't feel as bad having to order
the chip and waiting a few more days to get this working.
The MAX232 chip has two RS-232 outputs and two RS-232 inputs. That should be
enough for what you are trying to do. However, if you plan on using the
internal UASRT, I cannot think of any really good ways to generate the
RTS/CTS signals external to (i.e., in software) the USART hardware.
>> At the most important level, using a MAX232 chip inverts the signal
Besides inversion, the chips provide level shifting. The UART
output is 0V or 5V. RS232 (more correctly, EIA-232) is spec'ed
for 2 values: -25 to -3V and +3 to +25V. Area between -3V and
+3V is for noise immunity.
> Nuts, I was afraid I might have to order another component...
> I'm using the 16F877, so I would need to invert the signals.
> Do you know if any of the MAX-* chips can recieve/handle the
> CTS or RTS signals?
The MAX23x variants provide multiple outputs and inputs. The
number of each vary with the specific part.
Assuming a DTE device, one output would be used for transmit
data (TxD) and one input would be used for receive data (RxD).
The UART controls the actual signals.
The other inputs and outputs would be used for RTS, CTS, DTR,
DSR, RI, and any other signals. The signals from from a PIC
port with some bits set for output and others for input. The
actual handling of the signals is handled in software.
Lee Jones
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
>> I know this might have been asked before, but I was unable to find it in the list archive. What is they better way to setup a serial port? Lots of schematics use the MAX202 or MAX232 to transmit the serial data, while others just use a resistor on the RX and TX line. Is there any particular advantage to either way? The resistors would be easiest, since I could just run up to Radio Shack for those, but I don't know much about PICs or EE.
>
>Hi Ken,
>
>At the most important level, using a MAX232 chip inverts the signal(1
>becomes 0 and vice versa), whereas resistors do not.
>
>If you are creating a "virtual uart"(bit-bashing to create the port) then
>you can decide whether to invert or not, so either way can work.
>
>If you are using a PIC with a built-in hardware UART, you do not have the
>choice and must invert in hardware, either with a MAX232 type solution or
>using transistors.
>
>Using a MAX232 gives you strong signals and best compatibility. Using
>resistors will work "most" of the time.
..and if you know you will always be talking ot a PC, with a
reasonably short cable,(or at <=9600 on a metre or two), it will work
"all" the time - from experience of several thousand installed units I
would have no hesitation doing this in a production product.
-- http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics