Frequency counter with Atmel's ATtiny26

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 think the goertzel alogrithm would work well for you. This sounds like a DTMF decoder.
I understand your description, your basically comparing a known (timer) against an unknown.
But the goertzel is flexible and could run on a embedded processor with a few mips.

Plus I've allways wanted to try it ;)

Cheers

"Stefan F. M?ller" <StefanMueller65535@web.de> wrote in message news:3f3da1be.0403250934.3f4b8cac@posting.google.com...
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
 

Welcome to EDABoard.com

Sponsor

Back
Top