The following notes are to close out this thread. The findings here are available for future reference.
I tested the above question with actual hardware. The answer is yes, you can multiplex the hardware serial port pins. The pins can be enabled and disabled inline thus allow multiple usage.
Code:
'The following DEFINES are for EUSART at 16 mhz 2400 baud
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
DEFINE HSER_SPBRG 130 ' 2400 Baud @ 16MHz, 0.0%
SPBRGH = 6
BAUDCON.3 = 1 ' Enable 16 bit baudrate generator
APFCON0.7 = 0 'rx on rb1 (16f1826)
APFCON1.0 = 1 'tx on pin rb5 (16f1826)
'use the hardware serial port in this space. The switches connected to rb1 and
'rb5 pins are open, so no effect on communications
RCSTA.7 = 0 'disable hardware serial port (SPEN = 0)
TRISB = %11100010 'refresh portb register
'no communications needed in this space. The switches are active open and close.
Bookmarks