frequency detection with MSP430

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi. I'm working with the TI MSP430 and I'm trying to use the Timer_A
input to do frequency counting but so far I haven't been able to get it
working. I'm pretty sure I just haven't configured things correctly.
Does anyone have any sample code that shows the Timer_A input being
used to find the frequency of an input? Thanks.


Re: frequency detection with MSP430
lee says...
Quoted text here. Click to load it

You will need to tell us the frequency range you want to measure.
The techniques for determining frequency depend on whether the
input is higher or lower than the clock frequencies for
your counter/timer.

For lower frequencies:

set up the input pin to do an input capture on one edge or
another of your signal.  Capture  and count as many edges as necessary
until the accumulated period counts have enough resolution, then
do the math.

For higher frequencies

Put the signal into the clock input of the counter.  Then
use a lower-frequency clock from the other timer to gate
the input.   With the input count from timer A and the
gating interval from the other timer, you can calculate
the frequency.

The details depend a lot on the frequency range and the
precision you require,   and the time you are willing to
spend to collect a single reading.

Mark Borgerson

Re: frequency detection with MSP430
I'm going to be reading a frequency ranging between 500 KHz and 1 MHz.
I'll be running off an 8MHz crystal. Everything else is pretty fluid at
this point.


Re: frequency detection with MSP430
Hello Lee,

Quoted text here. Click to load it

With respect to Mark's two categories that would qualify as a high
frequency range.

Regards, Joerg

Re: frequency detection with MSP430
Quoted text here. Click to load it

I don't know anything about the MSP430, but an AVR can have it's timer run
on an external clock of Fclk/2.5. So an AVR running at 8MHz should be
capable of measuring 3.2MHz applied to the external timer input.


Re: frequency detection with MSP430
Hello Meindert,

Quoted text here. Click to load it

Many micros can do that. The MSP430 tops that a bit. For example, timer
A on the MSP430F1232 can be externally clocked at a whopping 10MHz when
the chips runs at 3V. At 2.2V VCC it still does 8MHz.

Regards, Joerg

Site Timeline