usart.bas Why these two lines?

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
robrlstn
Posts: 4
Joined: Mon Oct 24, 2011 9:08 pm

usart.bas Why these two lines?

Post by robrlstn » Tue Jul 17, 2012 3:13 pm

These three lines are in usart.bas

RCStatus = $90 // serial Port Enable, continuous receive
RCInput = True // receive pin Is Input
TXInput = False // transmit pin Is Output

For the 18F4620, only the first line seems necessary.

When RCSTA.7, or SPEN, is set by the first instruction, the directions of the RX/TX pins are configured. The 18F4620 data sheet says to leave TRISC.6 and TRISC.7 as 1 so that the proper configuration can happen.

So the following two instructions seem not needed, at least for this specific chip.

Are those two following instructions used by some other module or are they required to properly set RX/TX pins for some other chips?

Post Reply