Forum Discussion
Altera_Forum
Honored Contributor
14 years agoInterval Timer Problem
Hi, I got a system with an interval timer. Now I want to use it to to count how long the time is between two positiv flanks. But the counter won't start. My code: int count_timeH=0...
Altera_Forum
Honored Contributor
14 years agoMy system frequency is 50MHz and I always start the counter with 0xffff ffff. I think is not important for me to debounce the button because I want to simulate a time mesurement. Later I will get the signal from an external uC.
IF I read the snapL/snapH regs and do: --- Quote Start --- zwischen_speicher_vorher = IORD_ALTERA_AVALON_TIMER_SNAPH(SYS_CLK_TIMER_BASE)<<16; zwischen_speicher_vorher |=IORD_ALTERA_AVALON_TIMER_SNAPL(SYS_CLK_TIMER_BASE); --- Quote End --- then I should get the time of the following calculation: 0xffff ffff - 0xf99cc997 for example. But the solution is too big to be a time in "ms" because the number is something about "1.082139e+08 (ms)". I speak always about "ms" because I adjust it in QSYS for the interval timer. Now my questions are: 1."Is the time interval different from the adjusted time interval?" 2."Is the calculated number just the count width and not the time? "