usart.bas Question about two lines of code

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 Question about two lines of code

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

These two lines are in usart.bas, and used when there is a second EUSART, like in the 18F46K22.

RCInput As TRISC.Booleans(7), // As TRISG (2)
TXInput As TRISC.Booleans(6) // As TRISG (1)

These instructions would report the condition of the RX/TX pins. But it seems, not correctly, at least for the 46K22 as its RX2/TX2 pins are on PORTD, not PORTC as in the instruction, or PORTG as in the comment.

Likewise in usart2.bas, PORTG is used, so I would think that either usart.bas module would not properly work with a 46K22?

What am I missing here?

Jerry Messina
Swordfish Developer
Posts: 1470
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Post by Jerry Messina » Tue Jul 17, 2012 5:35 pm

What am I missing here?
Nothing. The library modules were written long before many of the current chips existed, and haven't been updated.

You'll likely find other incompatibilities as well, esp with the ADC.

User avatar
Senacharim
Posts: 139
Joined: Tue Aug 10, 2010 5:19 pm
Location: Ventura, CA

Post by Senacharim » Wed Jul 18, 2012 2:44 pm

You can make your own copy of modules and with a few #defines make it compatible with any PIC you're using.
Surviving Member
Bermuda Triangle Battalion
from 2026 to 1992

Voted "Most likely to time travel"--Class of 2024.

Post Reply