Hi! I am trying to work with dspic30f4011 UART capability. When the setting was in XT only, the UART was working. But when I edited it to XT with PLL 8x, no output came out from UART terminal.
My code is the one above. I have no idea what to change. I tried to change Baud rate from 9600 to 19200 but does not work. The settings are the following: **broken link removed**
I'm using mikroC here. The settings for oscillator can be edited through the Edit Project option in mikroC (see photobucket image above).
I don't have any experience with the mikroC environment and its libraries but I'm guessing that you need to fix the Oscillator Frequency field in your edit project window. The UART1_Init_Advanced() function has to make use of this value since you are telling the function what baud rate you want instead of telling it what your BRG (baud rate generator) register should be set to.
Change your Oscillator Frequency field to 8 times your crystal frequency and see what happens.
Oh so for example, my oscillator frequency(external clock) is 7.37Mhz, I only need to change this o 7.37*4? Ok. I will try this and update for the results. Thank you very much!
You need to multiply by *8 not *4 so use 58960000 and see how it ends up. You should inspect the code that is being generated to confirm that the compiler is working in this manner.