AnsweredAssumed Answered

Problem using PIT in PPC5748G

Question asked by Ville Vallinder on Jan 8, 2016
Latest reply on Feb 1, 2016 by Martin Kovar

Hello everybody!


I am trying to get the PIT going on a PPC5748G processor.

This is what I do:


1) Create a new S32DS C++ project using newlib.

2) Edit the main function so it looks like this:


int main()


    // Configure clocks to peripherals

    MC_ME.RUN_PC[0].R = 0x00000000;

    MC_ME.RUN_PC[1].R = 0x000000FE;     // configuration 1, peripheral clock active for all RUN modes

    MC_ME.PCTL[91].B.RUN_CFG = 0x1;     // PIT: select peripheral clock configuration 1, RUN_PC[1]


    xcptn_xmpl ();              /* Configure and Enable Interrupts */


    // Enable PIT module.

    PIT.MCR.B.MDIS = 0;


  counterclass myccounter;


  for(;;) {



   return 0;



3) Start a debug session.

4) Double-click on "EmbSys Registers/PIT/MCR": The value displayed is 0xFFF84000, which is actually the address of the register rather than the reset value 0x00000006 that I would expect.

5) Single step through the code.

6) After stepping into the line "PIT.MCR.B.MDIS = 0;" the session seems to hang. There is no indication of where execution is taking place, and it is no longer possible to read out register values.

7) Suspend execution: Execution stops at IVOR1_Vector() which I assume means that some sort of error has ocurred.


Can someone tell what I'm doing wrong or how to proceed?


I notice that there is no code to setup clocks in the template project.

Maybe the PIT module is actually not clocked at all when I try to access it.

Is there an example project using PIT interrupts that I can try?


Best Regards