I am attempting to run an 18F4520 at 32MHz with the internal oscillator and PLL (8MHz x 4) and am having problems. I notice because I am using the hardwae UART and the timing is exactly 1/4 what I code for. I use the "DEFINE OSC 32" statement, then "DEFINE HSER_BAUD 38400" and notice the output from the PIC is at 9600. This would make sense if the internall oscillator was running at 1/4 what I coded for.

The config statements I used are as follows:

'clock, PLL and port config
OSCCON = $7F
OSCTUNE.6 = 1
ADCON1 = $0F
CMCON = $07
DEFINE OSC 32

'harware UART settings
DEFINE HSER_RCSTA 90H
DEFINE HSER_TXSTA 20H
DEFINE HSER_CLROERR 1
DEFINE HSER_BAUD 38400

According to the datasheet, the PLL is enabled by OSCTUNE.6 and the first nibble of OSCCON being 0111 should result in an internal oscillator frequency of 8MHz. If someone could please explain the discrepency I would greatly appreciate it.

Thanks a lot.