S
Stefan F. M?ller
Guest
Dear All,
I'd like to confirm with you if my idea of a frequency counter with an
ATtiny 26 would work:
I have a signal with a few different tones <1KHz. I'd like to identify
the different tones to make some processings, identify their durations
and the pauses between the signals.
That's the way I'd like to do it:
The signal will be connected to the external interrupt. Parallel I
have Timer0 and Timer1 running at a certain period and incrementing a
variable (Overflow int-handler).
With the raising edge of the external signal the interrupt handler
will be fired. In this handler I will save the counter value of Timer0
and set it to '0'.
If I have e.g. 20 times the same counting value in Timer0, I have
identified the frequency (The frequencies of the different tones are
known, thus easily to compare). If the counting value in Timer0 is
different than the last one, I will save the counting value of Timer1
(signal duration) and reset it to '0'.
What do you think? Does this idea work?
I know there are other ways to measure frequencies, but I'd like to
know if the described solution would work.
Thank you for thoughts/hint, etc.
Best,
Stefan
I'd like to confirm with you if my idea of a frequency counter with an
ATtiny 26 would work:
I have a signal with a few different tones <1KHz. I'd like to identify
the different tones to make some processings, identify their durations
and the pauses between the signals.
That's the way I'd like to do it:
The signal will be connected to the external interrupt. Parallel I
have Timer0 and Timer1 running at a certain period and incrementing a
variable (Overflow int-handler).
With the raising edge of the external signal the interrupt handler
will be fired. In this handler I will save the counter value of Timer0
and set it to '0'.
If I have e.g. 20 times the same counting value in Timer0, I have
identified the frequency (The frequencies of the different tones are
known, thus easily to compare). If the counting value in Timer0 is
different than the last one, I will save the counting value of Timer1
(signal duration) and reset it to '0'.
What do you think? Does this idea work?
I know there are other ways to measure frequencies, but I'd like to
know if the described solution would work.
Thank you for thoughts/hint, etc.
Best,
Stefan