Baud rate when PLL used

General discussion on mikroPascal.
Post Reply
Author
Message
spcmicro
Posts: 10
Joined: 18 Oct 2008 11:54

Baud rate when PLL used

#1 Post by spcmicro » 01 Aug 2009 12:19

I have a project that uses serial communications via RS-232 using the USART library. If I set the clock speed of the processor to 8mhz, using an 8 mhz external crystal, all is good. When I set the clock to 32mhz and the PLL the serial communications fails. I set the clock back to 8Mhz and all is good. This seems to indicate that the USART library doesn't account for the clock speed used? If I'm missing something please let me know. If this is the case is it possible to correct the baud rate by writing to the PIC registers directly after the USART initialization function is called? If this is not possible, what is the recommended solution. Thanks in advance...

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

#2 Post by jpc » 01 Aug 2009 12:51

as long as the real clock of the PIC matches the frequency as set in the project all should be ok, did you verify if your PIC is really clocked at 32 mHz ? you can simply toggle e LED at 1 hZ rate to visualize possible errors of magnitude 4 as would be the case with PLL not beeing setup properly
Au royaume des aveugles, les borgnes sont rois.

Post Reply

Return to “mikroPascal General”