[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] How to accurately measure a square wave frequency
From: |
system default |
Subject: |
[avr-gcc-list] How to accurately measure a square wave frequency |
Date: |
Fri, 22 Oct 2004 04:26:21 -0400 |
Hi all,
My name is Joe, I am new to the list and AVR-GCC.
I am using an ATMega32, and would like to measure a
pulse on a pin. I was originally using a basic compiler
that had a high level function called PulseIn.
This function returned the time in 10uS ticks of the
high and low parts of the square wave.
I need something smilar to this so i can calculate the
frequency. I have never used AVR-GCC before so I am
unsure how to do this. I am using a 4Mhz crystal, If I use
a loop of some sort with a delay of 10uS how much error
will the code overhead cause? Does anyone already have
a method to determin the frequency of a pulse?
Or know a good method to do this?
Note: It must work on a range from ~100Hz to ~60kHz
Thank you very much.
-Joe
- [avr-gcc-list] How to accurately measure a square wave frequency,
system default <=