PLL Mode check in dsPIC33

Status
Not open for further replies.

gary36

Full Member level 4
Joined
Mar 31, 2018
Messages
208
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
1,806
Hi

I am currently using dsPIC33EV256GM106 and trying to experiment with the performance with and without PLL. My XTAL is 8MHz. I was trying with primary clock as well as FRC mode to compare the performance. I used the reference code from this link https://ww1.microchip.com/downloads/en/DeviceDoc/70005131a.pdf ( example 7-1 and 7-2). To my surprise with PLL (in FRC mode), the timing performance is worst. I am trying to toggle a port based on delay. What is the problem?

Timing
-------
without PLL --output toggles in 44us
with PLL based on the code below--output toggles at 290 us
But with primary clock timing is same with or without PLL as 44us.

Here is my code (MPLABX IDE V3.00) for FRC


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma config FNOC= FRC
#pragma config IESO= OFF
#pragma config POSCMD= NONE
#pragma config OSCIOFNC= OFF
#pragma config FCKSM= CSDCMD
 
 main()
{
PLLFBD=63;                      
CLKDIVbits.PLLPOST=0;                      
CLKDIVbits.PLLPRE=1;              //             
__builtin_write_OSCCONH(0x01);
__builtin_write_OSCCONL(OSCCON | 0x01);
while (OSCCONbits.COSC!= 0b001);
while (OSCCONbits.LOCK!= 1);
 
while(1)
{
  PORTCbits.RC11=1;
 delay();
  PORTCbits.RC11=0;
 delay();
}
 
void delay()
{
  char x;
for(x=0;x<10;x++){}
}

 
Last edited by a moderator:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…