2004-09-08 06:37 PM
idea to meaure wide range of input frequency?
2004-09-07 06:05 PM
input frequency range widely from 0.01Hz to 5KHz,
timer overflow will happen, and input capture is used, but both interrupt share the same vector , this may lead to critical condition that overflow counting is not correct, how to avoid this problem? or any better method to measure wide range of input frequency?2004-09-07 06:36 PM
In the interrupt routine, you can check the Input Capture status register to confirm that whether the interrupt occured due to Input Capture or Counter overflow.
2004-09-08 12:35 AM
1, input capture and timer overflow ,which gets the higer priority?
2,any sample code to measure events go beyond the timer range (FFFCH) using TOF with interrupt?2004-09-08 06:37 PM
1> Both have the same priority,
2> I don't have the sample code , but the algorithm can be as follows: ______________________________________________________________ MAIN: enable the Input Capture interupt. a=0; INTERRPT ROUTINE: If (interrupt is due to input capture) First time: Start the counter Second time: Stop the counter and read the value. Else (//means the interrupt is due to counter overflow) a++; _________________________________________________________________ In this way, you can measure the total time taken between two Rising edges of the signal at the input capture pin. And from this you can easily calculate the frequency. [ This message was edited by: chander on 09-09-2004 07:08 ]