I use the S32DS to Debug PIT program by PE Micro Multilink Universal ,when i was connected My MPC5743R,the timer has been stoped.And I was config the PIT_MCR_FRZ bit to 0. It was also doesn't work. If I powerdown the targetboard and pluck out the Plug from the JTAG port. And I power on the targetboard again.I find the timer is working.I have confused by this problem.Cloud you give me some advise to solved this.Thanks
I have attached the S32DS project file.
It could be that PIT is not running in debug mode.
Other thing could be your debugger is not able to read registers while code is running.
You usually do not step debug timers, you run them and check the interrupt or any flag change if they reach some point.
I had run the progrom and add a breakpoint in the pit ISR, The timer also dosen't work .And I have confirmed that my debugger is no problem. Because if I use the S32DS demo <pit_periodic_interrupt_mpc5746r> to flash into my targetboard and I can see the pit isr is running,Eventhough I had connected the debugger.
I am looking forward to you reply.
The timer also dosen't work
So your timer is not running?
In case you have clocks enabled for PIT:
// PIT Timer Initialization
PIT_0.MCR.B.MDIS = 0; //Enable PIT_0 timers
PIT_0.TIMER.LDVAL.R = 0x100000; // setup timer 0
PIT_0.TIMER.TCTRL.B.TIE = 1; // Timer interrupt enable
PIT_0.TIMER.TCTRL.B.TEN = 1; // start Timer
This is all you need for PIT to trigger TIF flag. Once TIF is set the IVOR4 is called and if ISR is configured, then you will end up after interrupt prologue in ISR - at your breakpoint)
So make sure your TIF is set when you run PIT.