Lifetime timer on MPC5777C

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

Lifetime timer on MPC5777C

Jump to solution
2,042 Views
20Sidar04
Contributor III

Dear Mr/Mrs,

I am working on lifetime timer on MPC5777C. I set my contiunging period maximum.

When I try to debug my controller on S32, My current_uptime variable is like below;

Start: 1111 1111 1111 1111 1111 1111 1111 1111 | 0000 0000 0000 0000 0000 0000 0000 0000

Time N = 1111 1111 1111 1111 1111 1111 1111 0110 | 0000 0000 0000 0000 0000 0000 0000 0000
Time N-1 = 1111 1111 1111 1111 1111 1111 1111 0101 | 0000 0000 0000 0000 0000 0000 0000 0000
Time N-2 = 1111 1111 1111 1111 1111 1111 1111 0100 | 0000 0000 0000 0000 0000 0000 0000 0000
Time N-3 = 1111 1111 1111 1111 1111 1111 1111 0011 | 0000 0000 0000 0000 0000 0000 0000 0000
Time N-4 = 1111 1111 1111 1111 1111 1111 1111 0010 | 0000 0000 0000 0000 0000 0000 0000 0000

But it should be FFFFFFFFF start of system. What make could it like that?

 

I share my source code below;

void lifetime_timer_init(void)
{
PIT->MCR |= 4; // clock for RTI Timers is enabled
PIT->TIMER[1].LDVAL = 0x0xFFFFFFFF; // setup timer 1 for maximum counting period
PIT->TIMER[1].TCTRL |= 5; // chain timer 1 to timer 0, timer1 start, disable timer1 interrupt
PIT->TIMER[0].LDVAL= 0xFFFFFFFF; // setup timer 0 for maximum counting period
PIT->TIMER[0].TCTRL |= 1; // start timer 0
}

lifetime_timer_init();

while(1)
{

current_uptime = 0;
current_uptime = (PIT->LTMR64H );
current_uptime= current_uptime <<32;
current_uptime = current_uptime + PIT->LTMR64L;

}

 

Best Regards,

0 Kudos
Reply
1 Solution
2,013 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I checked your code and it works fine. Below what I saw in S32DS

PetrS_0-1631688990985.png

BR, Petr

 

View solution in original post

0 Kudos
Reply
1 Reply
2,014 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I checked your code and it works fine. Below what I saw in S32DS

PetrS_0-1631688990985.png

BR, Petr

 

0 Kudos
Reply