Hi,
How are you programming the PIC? Are you using the MikroE USB bootloader that comes pre-installed or are you using an actual device programmer?
If you're using the bootloader then the CONFIG bits won't be written (I Think) and the chip will use whatever CONFIG was written to it when the bootloader was programmed into it.
What I'm trying to say is that the chip may not actually run at the speed you're telling the compiler (16MHz) but something else (and therefore the baudrate is wrong) depending on how the CONFIG bits are set and even though you include them in your code there's a chanse they're not written to the chip by the bootloader - but I don't know that for sure in the case of the MikroE USB bootloader. If you ARE using the bootloader then try to DEFINE OSC 48 instead.
If you're using an actual device programmer to program the chip then the default PBP CONFIG has the PLL enabled with a divide ratio of 5 which is suitable for a 20MHz x-tal. The board has a 16MHz x-tal so you need a divide ratio of 4 instead and then also DEFINE OSC 48 instead of 16 - OR change the oscillator type to normal HS instead of HSPLL.
/Henrik.
Bookmarks