Problem using PIT in PPC5748G

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem using PIT in PPC5748G

Jump to solution
3,143 Views
villevallinder
Contributor II

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(;;) {

  myccounter.increment();

  }

   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

Ville

Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
2,752 Views
martin_kovar
NXP Employee
NXP Employee

Hi Ville,

mode entry module configuration and clocks configuration seems not to be correct. Also PIT is not configured.

Please see attached project which shows, how to configure PLL as a system clock and how to configure clocks for peripherals. There is also PIT initialization and PIT interrupt handler which toggle user LED1.

If you have any question about the project, please feel free to write me back.

Regards,

Martin

View solution in original post

3 Replies
2,753 Views
martin_kovar
NXP Employee
NXP Employee

Hi Ville,

mode entry module configuration and clocks configuration seems not to be correct. Also PIT is not configured.

Please see attached project which shows, how to configure PLL as a system clock and how to configure clocks for peripherals. There is also PIT initialization and PIT interrupt handler which toggle user LED1.

If you have any question about the project, please feel free to write me back.

Regards,

Martin

2,752 Views
villevallinder
Contributor II

Thanks Martin, your project worked just fine!

Are there any other S32DS example projects available for this processor somewhere?

Best Regards

Ville

0 Kudos
Reply
2,752 Views
martin_kovar
NXP Employee
NXP Employee

Hi Ville,

I am sorry for delay, I was on the vacation last week. Unfortunately, we do not have another S32DS examples for MPC5748G. But I will try to port some examples from GreenHills IDE or create some new this year. S32DS is new IDE so I need some time for creating/porting examples. Please be patient.

Regards,

Martin

0 Kudos
Reply