I've set the hardware config totally manually from the datasheet and via PBP defines (suggested in the supplementary document PIC18FxxK42_notes) and many hybrids of the 2 methods.
Code:
OSCFRQ = %1000 '64Mhz
Define OSC 64
'******************************************************************************
'Configure UART Control Register 0
U1CON0.7 = 1 'BRGS = 1 (high speed baud generator)
U1CON0.6 = 0 'ABDEN = 0 Auto-baud Detect Disabled
U1CON0.5 = 1 'TXEN: Transmit Enabled
U1CON0.4 = 0 'RXEN: Receive Disabled
U1CON0.3 = 0 '0000 = Asynchronous 8-bit UART mode
U1CON0.2 = 0 '0000 = Asynchronous 8-bit UART mode
U1CON0.1 = 0 '0000 = Asynchronous 8-bit UART mode
U1CON0.0 = 0 '0000 = Asynchronous 8-bit UART mode
U1CON1.7 = 0 'Turn Serial port 1 off for baud setting
U1BRGL = 138 'Baud Divisor low byte
U1BRGH = 1 'Baud Divisor high byte
U1RXPPS = %1011 'Assign UART RX pin to RB3
RB0PPS = %010011 'Assign UART1 TX pin to RB0
U1CON1.7 = 1 'Turn Serial port 1 on
and the more straightforward method:
Code:
Define OSC 64
DEFINE HSER_RXREG PORTB
DEFINE HSER_RXBIT 3
DEFINE HSER_TXREG PORTB
DEFINE HSER_TXBIT 0
DEFINE HSER_BAUD 115200
If that was the issue, then why does everything in the quote marks come through okay?
Regards,
Troy
Bookmarks