please dont rip this site

PIC Specific RS232

There has been a lot of confusion on how the RX or TX pins should be set with reguard to TRIS on the PICs with hardware USARTs especially with reguard to makeing them work in interrupt mode.

First, keep in mind that MPLAB does not (correctly or otherwise) simulate the USART Hardware.

Second, read the datasheets.

From DS30292B-page 33 (the '873 datasheet section 3.3 PORTC and TRISC Registers):

When enabling peripheral functions, care should be taken in defining TRIS bits for each PORTC pin. Some peripherals override the TRIS bit to make a pin an output, while other peripherals override the TRIS bit to make a pin an input. Since the TRIS bit override is in effect while the peripheral is enabled, read-modify-write instructions (BSF, BCF, XORWF) with TRISC as destination should be avoided. The user should refer to the corresponding peripheral section for the correct TRIS bit settings.

From DS30292B-page 95 (the '873 datasheet section 10.0n on USART):

Bit SPEN (RCSTA<7>) and bits TRISC<7:6> have to be set in order to configure pins RC6/TX/CK and RC7/RX/DT as the Universal Synchronous Asynchro-nous Receiver Transmitter.

In Microchip lingo "set" means make the bit a 1.

The bottom line, don't do read-modify-write operations on a TRIS register that is controlling pins with another active peripheral, such as the TRISC register when using the UART or CCP.

Finally, PICUART.ZIP from  or is known to work and explains most of the common problems.


rs232@ TTL to/from RS232@ TI Calc@ PIC C IO@

See also:

cover "Serial PIC'n : PIC Microcontroller Serial Communications" by David Benson


file: /Techref/scenix/lib/io/osi2/serial/rs232.htm, 6KB, , updated: 2003/6/15 10:07, local time: 2018/1/19 02:03,

 ©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE! / 

<A HREF=""> PIC Specific RS232 </A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

Quick, and RELIABLE! RCL-1 RS232 Level Converter in a DB9 backshell only $25.00
Ashley Roll has put together a really nice little unit here. Leave off the MAX232 and keep these handy for the few times you need true RS232!

Welcome to!