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.

serial port interfacing question

Status
Not open for further replies.

irfanhab

Member level 1
Joined
Aug 9, 2004
Messages
41
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
497
Hi,

I'm designing cicuit which makes use of the serial port,.

Now the 89c52 microcontroller has an inbuilt UART, I read from somewhere, that it needs +10V for a logic 1 or soemthing, but I'm powering the MCU with +5V, will it work? and from where do I apply extra +12V??

One more questions is that if I build a device to control another device both running on the MCU UART, do i need to supply extra power to both?? that is power apart from the +5V to the MCU?

Someone was telling me about a MAx 232 chip which converts the Rs-232 (serial port) voltage levels to ttl voltage levels, but I think the max 232 chip is only when I'm using the computer's serial port, or do I need to use it also in MCU to MCU communication?
 

as a matter of pre-caution, check with the specifications sheet if both the Rx and Tx pins operate on the same voltage level i.e. both work at 5v ttl or 10v etc. if yes (and thats most likely to be), then there is no need to convert levels, just connect the right pins and start testing. otherwise u will need to convert levels by some method to make the two communicating ports compatible with each other.
 

Hello

Can you use MAX232, it may solve voltage level differneces.

Regards
 

I saw a post like yours asking the exact same question. Sometimes searching helps.

MCU to PC:
You will have to use MAX232 or similar IC.

MCU to MCU:
If the two MCUs are powered from the same power source (ie. MCUs are on same board), then there is no need for MAX232.

If the two MCUs are powered from different power sources (ie. MCUs are on different boards), It would be advisable that you use MAX232.

Sputnik :idea:
 

The serial port on your micro will operate with the logic levels of the device. If it is powered from 5V then there is no way that you are going to find more than 5V on any pin. Applying 10V to any pin will destroy the device. I know of no micro with a built in RS232 converter.

The reasons to use buffers are not as simple as matching power supplies. You use buffers to reduce the effects of noise on the communication, improve the performance over long distances and/or capacitative effects, common mode voltage difference, voltage supply/voltage logic level differences and electromagnetic noise immunity and protection.

If your processors are on the same board and on the same supply with no real noise problems then you can get away without buffering. If you want to multidrop though (more than 2 micros communicating on the same wires), you must be able to place your transmitter pin in high impendance (or at least open drain).

Obviously if your processors are operating at different supplies but the same voltage with a common ground you need to be careful that excessive current doesn't flow from one to the other, especially at startup. This can be limited by a resistor in series (although the RC effect may reduce communication speeds).

If the voltages are not the same, but with a common ground, then the logic levels are probably not compatible and you will have to indulge in some level shifting.

If the grounds are not common then of course you need some form of isolation.


For longer distances, if you can tolerate a common ground between the processors then you can use RS232 if you can live with the limitations of RS232- 50ft transmission distance and up to about 200Kb/s (depending on which version of the standard and drivers you work with) The longer the transmission distance, the slower the maximum speed you can use. If your grounds can't be commoned then consider opto isolated RS232. (More modern PCs tend not to have RS232 ports and you may need a USB to RS232 adaptor.) RS232 does not allow multidropping in general, although I think RS423 (an upgrade) may do so.

Longer distances need different techniques. Today RS422 or 485 (the major difference is that RS485 allows multidropping) is very common for longer distances since it is differential. It allows up to 10Mb/s or up to 1km, but not both simultaneously. It is also more tolerant of common mode differences in the ground voltages allowing a variation of -7 to 12Vdc. There are also isolated RS485 drivers that will resolve ground potential difficulties as well. See my application note "RS485: A primer" here
**broken link removed**
for a discussion on distance versus length plus other considerations for RS 485. There are also plenty application notes on the web- just search.

For higher speeds you can try fibre-optic (which is inherently isolated) or copper techniques like PECL or LVDS.

-Aubrey Kagan
 

Thanks everyone, esp. antedeluvian for a detailed response
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top