Originally Posted by
svjohngalt
Define OSC 16
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h
define HSER_BAUD 9600
DEFINE HSER_CLROERR 1
DEFINE HSER2_RCSTA 90h
DEFINE HSER2_TXSTA 24h
define HSER2_BAUD 9600
DEFINE HSER2_CLROERR 1
return
Sinde you say that UART1 is working fine with your config settings, then UART2 should also be working fine with the same config settings.
Change your lines to
Code:
DEFINE OSC 16
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 160 ' 9600 Baud @ 16MHz, -0,08%
SPBRGH = 1
BAUDCON.3 = 1 ' Enable 16 bit baudrate generator
DEFINE HSER2_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER2_TXSTA 24h ' Enable transmit, BRGH = 1
DEFINE HSER2_CLROERR 1 ' Clear overflow automatically
DEFINE HSER2_SPBRG 160 ' 9600 Baud @ 16MHz, -0,08%
SPBRGH2 = 1
BAUDCON2.3 = 1 ' Enable 16 bit baudrate generator
Bookmarks