Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

MCU-PC Serial Communication

Status
Not open for further replies.

Slayerza

Full Member level 5
Joined
Oct 22, 2005
Messages
295
Helped
27
Reputation
54
Reaction score
5
Trophy points
1,298
Location
South Africa
Activity points
3,462
Hi,
I have a simple question about the use of MAX232 ICs to connect MCUs to PCs.
Do you connect the MAX233's Tx and Rx pins to the MCU's Tx and Rx pins straight or crossed over. Secondly since the MAX232 acts as DCE and the PC as DTE the connecting cable must be straight through?

Thanks in advance
Henri
 

hi
search web for schematic and you can find it.
or see datasheet and circuit of it.
regards
 

The MAX232 is JUST a buffer - if the same job is done by a few transistors they remain transistors and do not become DCE or DTE.

DTE - intellegent controlling equipment - computer.
DCE - dumb communication equipment - modem.

The EIA232 protocol is the most abused and misused communication protocol. It was never originally designed to be DTE-DTE (null modem).
It has evolved to incorporate DTE-DTE in many forms. Multi handshake, single handshake, software handshake, no handshake.

µP & µC are normally considered DTE. PC is considered DTE.
PC to µC is most simply done by 3-wire crossed-pair (TX=RX RX=TX Gnd=Gnd)
It requires intellegent control by both pieces of equipment.

Read these:
https://www.cableeye.com/Data_Com_Basics/RS232_standard.html#anchor242192

https://www.lammertbies.nl/comm/info/RS-232_null_modem.html#noha

hope this helps ... Polymath
 

You do not need to think in terms of DTE and DCE.

Simply work this way: the TxD signal on the computer must reach the RxD pin on the MCU, through the RS-232 transceiver. And the RxD pin on the computer must be connected to the TxD pin on the MCU, again through the transmitter.

So make sure you connect the MAX232 properly, that is, its "receiver" should have the input connected to the TxD output on the computer and its output to the RxD pin on the MCU. The "transmitter" in the MAX232 should have its input connected to the TxD pin on the MCU and its output to the RxD signal on the PC.

The question of the cable then comes about if you use a 9-pin female or male connector on your MCU board. If you use a female connector on your board, then wire it as a DCE. If you use a male connector then wire it as a DTE and make sure the cable is a crossover one.
 

VVV said:
You do not need to think in terms of DTE and DCE.

................................. If you use a female connector on your board, then wire it as a DCE. If you use a male connector then wire it as a DTE and make sure the cable is a crossover one.

VVV
You own advice appears to be conflicting - are you confused?

Does Slayerza need to think in terms of DTE/DCE or not?
************************************************


I think this simple diagram may clarify:
**broken link removed**

A point to note:
RS232 TxD and RxD are transmitted as inverted logic:
logic '1' is -3V to -12V and logic '0' is +3V to +12V

a MAX232 inverts the signal.

regards ... Polymath
 

polymath said:
The MAX232 is JUST a buffer - if the same job is done by a few transistors they remain transistors and do not become DCE or DTE.

You're correct about DCE/DTE not being an issue but it's also important to note that it's not "JUST a buffer".

All four translators invert the signals. Two of the translators convert TTL level inputs to RS232 level outputs and the other two translators convert RS232 level inputs to TTL level outputs. Only the RS232 signal level side of the translators (inputs or outputs) should be connected to the DB9 socket and only the TTL level side of the translators should be connected to a microcontroller.

You can also use a simple open-collector transistor circuit or open-drain MOSFET circuit to provide the invertor/translator function. You would use a straight through DB9M-DB9F cable for the circuit below.

Kind regards, Mike
 

Thanks to everybody for their help. I have now got comms between the PC and my MCU

Cheers
Slayer
 

HI Mike,,,, K8LH

From Wikipedia
Buffers are used for many purposes, such as (a) interconnecting two digital circuits ..........

A buffer amplifier (sometimes simply called a buffer) is one that provides impedance transformation ...........................

If you wish to be pedantic
Mike said:
All four translators.........

The MAX232 data sheet - the description of translators does NOT occur at all - nor does buffer.
The MAX220–MAX249 family of line drivers/receivers ...............
and the four sections in the MAX232 are decribed as:
True RS-232 Transceivers......................
........RS-232 drivers, RS-232 receivers,...................


hope this clarifies ... Polymath
 

@Mike

Yeah it was a wiring problem, had crossed both sides of the MAX :!:
But a simple mistake aside, the code is at least functional.

Cheers
H
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top