+ Post New Thread
Results 1 to 2 of 2
  1. #1
    Member level 5
    Points: 704, Level: 5

    Join Date
    Mar 2018
    Posts
    88
    Helped
    0 / 0
    Points
    704
    Level
    5

    PLL Mode check in dsPIC33

    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 http://ww1.microchip.com/downloads/e.../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 bassa; 15th March 2019 at 08:26. Reason: add code tags

    •   AltAdvertisement

        
       

  2. #2
    Newbie level 3
    Points: 29, Level: 1

    Join Date
    Mar 2019
    Posts
    4
    Helped
    0 / 0
    Points
    29
    Level
    1

    Re: PLL Mode check in dsPIC33

    Finally it worked based on the link https://www.microchip.com/forums/m903494.aspx



--[[ ]]--