0
\$\begingroup\$

I am working on a project and I use several PIC18F26K83's for this project. For communication between PIC's I use UART. Now I also need to send data with RS232 to the user. As I have understood the main difference between UART and RS-232 is voltage levels. And with PIC I cannot supply proper voltage level that is required for RS232. Because of that UART to RS232 converter's look like a must. (i.e. MAX232) I have two questions.

  1. Using UART to RS232 chips is the only option in this case? Are there any alternative ways?

  2. I am planning to send UART data directly to the UART to RS232 converter chip. I do not know how they work, code wise do I need to change anything? Can I directly put UART tx data to the receive pin of these chips? Thanks beforehand.

\$\endgroup\$
2
\$\begingroup\$

1) Using UART to RS232 chips is the only option in this case? Are there any alternative ways?

Of course, you can implement a level converter using discrete hardware. For instance, this site describes the following very simple circuit:

enter image description here

Please take care of the "operating notes".

code wise do I need to change anything?

No.

Can I directly put UART tx data to the receive pin of these chips?

Yes.

\$\endgroup\$
  • \$\begingroup\$ Remember that this driver, like most you can buy, inverts between UART and RS232. \$\endgroup\$ – Cristobol Polychronopolis Mar 19 at 13:42
  • \$\begingroup\$ Does that it does not invert RS232 to UART? \$\endgroup\$ – Günkut Ağabeyoğlu Mar 19 at 14:09
  • \$\begingroup\$ That circuit won't meet RS232 specifications. It may often work, but only if connected to something that goes beyond specification. Use a chip that does it right with charge pumps, or the old way with extra power supplies. \$\endgroup\$ – Chris Stratton Mar 19 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.