This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Clock problem



Hi,

I am using the c2000 F28M35H52C1 CC with the docking station with Code Composer Studio v5

I am using the setup_m3 project and the cpu_timers_c28 projects.

I program the timer 0 (on the C28) to make an interrupt every 50 µs

ConfigCpuTimer(&CpuTimer0, C28_FREQ, 50);

And during the interruption of the Timer I toggle a GPIO :

interrupt void cpu_timer0_isr(void)

{

    GpioG1DataRegs.GPBTOGGLE.bit.GPIO34 = 1;

     counter++;    

    GpioG1DataRegs.GPBTOGGLE.bit.GPIO34 = 1;

    // Acknowledge this interrupt to receive more interrupts from group 1    

    PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;

 }

 

Here is the procedure that I follow with the debugger. (PART 1)

  • connect to M3
  • connect to C28
  • Flash the C28
  • Flash the M3
  • Run the C28
  • Run the M3

Then I observe on my scope that the interruption of the timer is every 50 µs and the GPIO is set up during 400 ns (this is very long) ?!!

So I have done this : (PART 2)

  • Pause the M3
  • Pause the C28
  • Restart M3
  • Restart C28
  • run C28
  • run M3
  • Pause M3

After the pause of the M3 I get an error (I guess it is)

Then :

  • Pause the C28
  • reFlash the C28
  • run the C28

Then I observe on my scope that the interruption is every 100 µs and the GPIO is set up during 100 ns (better) ??

So I suppose that my clock is faster and it's what I wants to.

How I can get this faster clock speed without doing all the step of (PART 2) ?

Thanks in advance.

Regards

Adrien

 

 

 

 

  • Hi,

    I am still working on that problem, but I guess I discovered something new.

    The code line : counter++; take two assembly instructions.

    With the debugger I set up a break point and I follow the timer counter value for the execution of these instructions

    The timer count 0x0011 for the execution of that code line =>  it is 17 in decimal base => count 17 at 150 MHz take 100 ns but there is two instructions so one instruction take 50 ns so the system frequency is 20 MHz !

    but in my M3 I set up the system PLL at 150 MHz like that :

        // Sets up PLL, M3 running at 75MHz and C28 running at 150MHz    

    SysCtlClockConfigSet(SYSCTL_USE_PLL | (SYSCTL_SPLLIMULT_M & 0xF) | SYSCTL_SYSDIV_1 | SYSCTL_M3SSDIV_2 | SYSCTL_XCLKDIV_4);

    I really don't understand why my system clock is at 20 MHz, it seem to be the quartz frequency but I why I get that ?

    How I can get a 150 MHz system clock ?

    Thanks in advance

    Regards

    Adrien