RCM4110 Timer C Query

Hi,

I’m a novice to embedded controllers and am finding my way around the 4110 architecture, asm and C programming. So have a lot to learn. My query pertains to Timer C. The application I have in mind for Timer C is to create a set of sampling pulses synchronized to an external interrupt. The general idea is as follows:

On an external interrupt start Timer C by writing 1 to bit 0 TCCSR . Timer will then set and reset output according to Set and Reset register settings. Once timer reaches max count, Interrupt generated and serviced by ISR handler.

ISR handler will stop Timer C. When the Interrupt is generated, the counter will be at 0. However by the time the ISR handler stops the timer, the counts may not be at 0 ??. What do I need to do within the ISR to ensure that the counter is at 0 counts with Timer C off.

On the next external interrupt ( about 140 micro seconds later) Timer C will be started but the counts must commence from 0. How do I set this up in the ISR. :confused:

Regards,

Stefan

Hello,

I’m using Timer C interrupt on my Rabbit 4000 and I have the same problem.

  • Is it possible to read the current value of Timer C counter?
  • How can I reset its value to be sure that next time I start the timer with
WrPortI(TCCSR, &TCCSRShadow, 0x1)

the counter will be at 0?

Thank you.

Giovanni