I would like to get UART running with the 4MHz clock but I am having the same issue as the other user. I run CFG_Peripheral_Config(); first and set the clock frequency. I would like to set the UART baud rate for 9600. For the 1MHz clock I get a value of 25 for the baud rate divider (0x19 in the BAUD_RATE_LO reg.) and I can get bidirectional UART communication.
When I try and set the CPU clock to 4MHz and change the baud rate divider to 103 (0x67 in the reg.) I cannot get proper communication. It seems to be a timing issue because when I look at the UART output on a scope while sending the value 0x32 in the TX reg, the waveform looks correct except each bit is nearly twice the expected 104us time.
I tried to run it at 2MHz, again changing the divider to 51 (0x33 in the reg.) but end up with a mistimed waveform similar to the output at 4MHz. I did not try the 500kHz because that is far too slow for our application.
Has anyone gotten UART communication at a clock speed other than 1MHz?