I'm using USART of PIC18f2455 with RS232 and having some trouble to configure it.
I'm using a 24 MHz Crystal Oscillator. The PLL is enabled with prescaler of 6 (to set 4MHz at input) and gives a fixed 96 MHz at output. The postscaler is set to 6 giving at end a 16MHz to Microcontroller clock.
With this clock I set the SPBRG of OpenUSART function to 25 for a Baud Rate of 9600 .
This is my USART config:
#pragma config PLLDIV = 6, CPUDIV = OSC4_PLL6, USBDIV = 2, FOSC = HSPLL_HS OpenUSART(USART_TX_INT_ON & USART_RX_INT_OFF & USART_ASYNCH_MODE & USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_LOW, 25);
It is getting stuck at OpenUSART function...