Altera_Forum
Honored Contributor
12 years agoUsing timestamp in an interrupt
Hi, i wanted to use the timestamp driver to get an approximation of the time spend in an ISR. Has anyone tried/achieved this? Should it be possible?
I have tried it, but even if i do sequential timestamps, then i consistently get a difference of more than 260,000 counts. It can't possibly be taking this long to run that code. Debugger is connected for purposes of download to RAM, but debug is off. Timers and Nios II are connected to a 50MHz clk. The timestamp driver seems to be working fine elsewhere in the code and has an overhead < 100 counts . Could this be anything to do with it being in the interrupt? I do have other interrupts running, but even if nesting was somehow enabled, then surely the code i have used would prevent them interrupting this code? alt_irq_context context1 = alt_irq_disable_all(); TIMESTAMP(start_of_tick); TIMESTAMP(end_of_tick); alt_irq_enable_all(context1);void
timestamp(unsignedint index){//use the altera timestamp driver to get the time m_timestamps[index] = alt_timestamp(); }