AGlass0fMilk 5 Posted July 12, 2011 Share Posted July 12, 2011 I am trying to make a frequency counter in order to experiment with the MSP430G2553. But as a beginner to microcontrollers (although not programming), it is proving harder than I thought (an operating system certainly hides a lot!) This project is supposed to be able to measure quite low frequencies (at most ~1.5kH) and I need to sample multiple frequencies at a time. From my understanding of the research I've currently done, one possible (quick) formula to measure a frequency is to start a counter at the rising edge of a frequency, and then stop it at the next rising edge of a frequency, take the value and then find the reciprocal (1/counter_value) or sample the frequency like this for multiple cycles and then find the average. I also believe that one possible way to do this is to use the Timer_A peripheral of the MSP430G2553 in capture mode, which I understand to have 3 channels for capture (which means I can determine 3 different frequencies with one chip simultaneously?). But where I am having trouble is the actual programming aspect of this project as I am new to microcontrollers and I am quickly realizing that there is a lot more to programming embedded systems than desktop computers! I have a couple of questions: Are my described methods correct/efficient/accurate? If not, what is the best formula for determining a frequency real-time (it must be done as fast as possible) Is my assumption that 3 frequencies (channels) may be analyzed by Timer_A at once correct? Or are there more/less channels available? How do I set up the Timer_A to be sourced by an external 32kH watch crystal? (Apparently Internal DCOs are notoriously inaccurate) I know I should look at the User Guide/Datasheet, but there's a lot of information in there and it is a skill itself to be able to navigate and pick out the information you need quickly, so can you point me towards certain sections/examples to help me set this up? Quote Link to post Share on other sites
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.