PBP's DEFINE HSER_BAUD is for setting up the baud rate of a USART.
The compiler has no way of knowing when you set BRG16 (BAUDCON.3) in your code for EUSART 16-bit baudrate mode.
For 16-bit mode, you must set the baud rate values manually.
Code: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 64 ' 9600 Baud @ 32MHz, 0.04% SPBRGH = 3 BAUDCON.3 = 1 ' Enable 16 bit baudrate generator




Bookmarks