At 16:19 02/28/99 +0530, Ravi Pailoor wrote: >Bob Blick wrote: >> On which chip? Let me quote from the 16C7x data sheet: >> ------------------------------------------------- >> 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 for the Serial Communication Interface. >> ------------------------------------------------- >> Notice it says "set" not "clear". > >Does SET mean set the port bit as output ? > >The documentation is / may not clear in defining the state the Tx port >pin that has to be "set". no, it is quite clear: it says the bits 6 and 7 of the TRISC register have to be set, which means the ports would be configured for input (ie. the output driver would be disabled), if they were just plain ports. if you have a look at the "portc block diagram (peripheral output override)" of a data sheet, you see the "peripheral oe" output enable, this is the one that switches the port to output when you activate the associated peripheral (by some internal logic connected to the peripheral configuration registers). when you look at that, you also see an explanation why it still works when you declare the tx pin as output (as andy kunz observed): you'd just double on what the internal "peripheral oe" does (that's the or gate for /q from the tris latch and the peripheral oe). but i guess you =have= to declare the rx input as input if you want it to work as rx, since the "peripheral oe" only can =activate= the output driver, it can't =deactivate= them (that's again the same or gate). anyway, i declare both of them as inputs (set the associated trisc bits 6 and 7) and let the internal peripheral logic do its work, as they say in the data sheets. ge