Hi,
I am reading the CPU timer to measure the frequency of a signal.
The signal is sampled in a ISR and every zero crossing I read the timer value. (I use both a 32bit variable and a 16bit variable)
timer_value32=CpuTimer0.RegsAddr->TIM.all;
timer_value16=CpuTimer0.RegsAddr->TIM.half.LSW;
Both instruction gets the correct value the first time the ISR is called, but after that, both variables get 0. I am monitoring the timer value under the registers and it is not correct.
Right now I have no idea what could be causing the problem.
Also, I tried to assign the value reading directly the register (like I would do with the MSP430) but the compiler says that TIMER0TIM is undefined. Am I missing something?
timer_value16=TIMER0TIM;
thanks
Marco