SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on how to get your MSP JTAG programmer up and running.
By GregoireLeGros
#147379
I got myself a Launchpad kit and am tinkering with it and learning a little. I'd like to build a frequency counter and I think I can use an MSP430 type to count ticks between rising edges on the signal to be measured. If I wanted to measure a frequency of say 10 Mhz what sort of MSP430 should I use ? What is the difference between the crystal, the oscillator and the resonator and what value should I use to build my frequency counter ?
By FLOWMEET
#152209
I can't figure out how to measure 10MHz frequency with reasonable resolution using MSP uC, without using any external support

1. Crystal, usually yo can get if in very wide frequency range, 32768Hz is the most used over MSP430
2. Ceramic are cheaper than crystal, but only appreciated for mass production, I think its true for very very large production, and it is no so accurate like crystal
3. Oscillator, I think you want say internal oscillator, it is formed by two on chip passive components, a resistor and capacitor, may by external too, it it not recommended for time measurement, it is too temperature dependent.

Best Regards
Daniel
http://www.flowmeet.com
User avatar
By viskr
#152244
You'll want to use a crystal, the other options don't offer accuracy much better than 1%, where even a cheap crystal will be better than 100 ppm (0.01%).

Most any micro will have a timer element (including the MSP430), and that is the way to provide accurate timing.

Basically you will time a number of events (transitions on a pin vs counts of the internal crystal oscillator).
User avatar
By viskr
#152281
I can't speak to the timers of the MSP430, but in ARM timers, you can set the up to count transitions and when a certain count is reached as compared to a match register, the time of that event can be captured in a register.

So you count 1000 or transition and capture the time in terms of the internal clock, and that gives the resolution you need, if you need more time more than 1000 transitions.