Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/04/07 18:46
Read: times


 
#142768 - An idea
Responding to: ???'s previous message
You want to measure 2048Hz. If the resolution you expect is 1Hz, you should generate some "internal clock" of 1s (an interrupt service routine provoked by one of the timers overflow and some extra code can do that), and measure the value in a counter register, which was incremented each cycle of the external signal you want to check. This task can be done using T0 or T1 counter inputs. So, the ISR reads the counter each second, copy it to a safe place, and clear the counter, starting again. Then you can average several measurements, sending then to some place, etc.

The alternate method of measuring period will give you lower resolution (for this 2048Hz signal) and will keep the uC very busy.

This is the raw idea. You must polish it, looking for latencies, for your specific resolution, etc.

DC

List of 3 messages in thread
TopicAuthorDate
measure the frequency            01/01/70 00:00      
   Yes you can            01/01/70 00:00      
   An idea            01/01/70 00:00      

Back to Subject List