This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM46L852: Timing Measurements Using Timers

Part Number: RM46L852
Other Parts Discussed in Thread: HALCOGEN

Im using the RTI module to trigger a 1msec interrupt (using compare 0) and trigger task execution in my application. -  Halcogen Compare module 0 uses timer 0 (1msec compare - counter freq 55Mhz)

I noticed  that every time this interrupt triggers and I attempt to get counter ticks (for timing measurements) using rtiGetCurrentTick(rtiCOMPARE0)

the tick counts resets. 

what is the best way to configure the setup using HALCOGEN to obtain timing measurements.

in this case I'll like to have a free running timer to calculate task execution jitter.

My current config for this task scheduler is, 

main(){

/* Initialize RTI driver */
rtiInit();

/* Enable RTI Compare 0 interrupt notification */
rtiEnableNotification(rtiNOTIFICATION_COMPARE0);

/* Start RTI Counter Block 0 */
rtiStartCounter(rtiCOUNTER_BLOCK0);

}

  • Hello Dorian,
    Interrupt is generated when counter RTIFRCn matches the compare value in RTICOMPn register. When this happens value from RTIUDCPn is added to RTICOMPn. In this way periodic interrupt is generated. rtiGetCurrentTick does not reset values of registers. rtiGetCurrentTick returns value that is between two compare matches (tick = RTI_CNT_FRCx - (RTI_CMP_COMPx - RTI_CMP_UDCPx);). You can make your own function to read counter in different way.
    Take a look at this application note for execution time measurement examples: www.ti.com/.../spna138a.pdf
    More on RTI counter/compare/interrupts you could find in device TRM chapter 13 : www.ti.com/.../spnu514c.pdf

    Best regards,
    Miro
  • I see .. was able to modify this function rtiGetCurrentTick to get raw count instead of the delta .. thanks !