Hi, Does anyone have any sample code that shows how to set up uart 0 to use the internal Baud rate generator ?
My Code for Using Built in baud generator for both serial ports. Hope it helps :- // initialise on board comms BRGCON = 0; //12 MHz BRGR0 = 0xD2; BRGR1 = 0x4; //Set To Baud rate generator to 9600 //11.0592 MHz // BRGR0 = 0x7E; // BRGR1 = 0x4; //Set To Baud rate generator to 9600 BRGCON = 3; T2CON = 0x30; // RCLK=1. TCLK = 1, Timer 2 Disabled SCON = 0x50; // SCON: mode 1, 8-bit UART, enable rcvr REN_0 = 1; ES0 = 1; // Enable Interrupt TI_0 = 1; // TI: set TI to send first char of UART //Uart 2 S1CON = 0x50; // SCON: mode 1, 8-bit UART, enable rcvr REN_1 = 1; ES1 = 1; TI_1 = 1; // TI: set TI to send first char of UART