<< Chapter < Page Chapter >> Page >
Using the MSP-EXP430FG4618 Development Tool and the MSP430FG4618 device perform a frequency measurement.

Laboratory timers: lab5 - frequency measurement

Introduction

Correct system timing is a fundamental requirement for the proper operation of a real-time application. The timing definition can dictate how the data information processed during the execution of the application program. The clock implementations vary between devices in the MSP430 family. Each device provides different clock sources, controls and uses. This chapter discusses the clock controls included in the platforms used.

The MSP430 4xx family has two general-purpose 16-bit or 8-bit counters and event timers, named Timer_A, Timer_B, and a Basic Timer. The Basic Timer module is only implemented in ‘4xx devices. The 2xx device family also has Timer_A and Timer_B, but the clock signals are provided by the basic clock module+.

The timers may receive an internal or external clock. Timer_A and Timer_B also include multiple independent capture and compare blocks, with interrupt capabilities.

Overview

This laboratory implements an application ( Lab5_Timers.c ) designed to measure a PWM signal frequency. If a signal generator is not available, the microcontroller generates a PWM signal based on the frequencies stored in a file. The frequencies generated are read and updated with a fixed time period using the features of CCE . The measured value is shown on the LCD in Hz.

Resources

The module FLL+ is configured to a frequency of 7.995392 MHz for the MCLK and SMCLK clock signals. This application performs the two tasks simultaneously.

On the one hand, it generates a PWM signal with a frequency of 200 Hz and a duty cycle of 50%. Alternatively, the PWM signal frequency can be read from a file using a breakpoint. This function is performed by Timer_B, using the compare unit to generate the PWM signal.

The time period between two consecutive PWM signals low-to-high transitions is measured by Timer_A. The capture unit of this timer is configured to collect the Timer_A counter register’s contents when a PWM signal low-to-high transition is detected at its input.

The Basic Timer1 generates an interrupt once every second. The ISR updates the PWM signal frequency generated by the Timer_B. If you choose to use this feature, a breakpoint associated with this ISR execution allows reading a file with the value of the frequency that will be generated.

The microcontroller’s ports are configured in order that the PWM signal generated by Timer_B through the TBCCR4 compare unit available at Port P3.5/TB4 can be connected to the Port P1.2/TA1 of the Timer_A TACCR1 capture unit. If you plan to use this feature, these pins must be connected together. Port P3.5 pin is available on Header 7 pin 6, while the Port P1.2 pin is available on Header H2 pin 3.

Ports P2.1 and P2.2 are used to monitor the state of the LED2 and LED1, respectively.

The resources used by the application are:

- Timer_A;

- Timer_B;

- Basic Timer1;

- I/O ports;

- FLL+;

Questions & Answers

what is mutation
Janga Reply
what is a cell
Sifune Reply
how is urine form
Sifune
what is antagonism?
mahase Reply
classification of plants, gymnosperm features.
Linsy Reply
what is the features of gymnosperm
Linsy
how many types of solid did we have
Samuel Reply
what is an ionic bond
Samuel
What is Atoms
Daprince Reply
what is fallopian tube
Merolyn
what is bladder
Merolyn
what's bulbourethral gland
Eduek Reply
urine is formed in the nephron of the renal medulla in the kidney. It starts from filtration, then selective reabsorption and finally secretion
onuoha Reply
State the evolution relation and relevance between endoplasmic reticulum and cytoskeleton as it relates to cell.
Jeremiah
what is heart
Konadu Reply
how is urine formed in human
Konadu
how is urine formed in human
Rahma
what is the diference between a cavity and a canal
Pelagie Reply
what is the causative agent of malaria
Diamond
malaria is caused by an insect called mosquito.
Naomi
Malaria is cause by female anopheles mosquito
Isaac
Malaria is caused by plasmodium Female anopheles mosquitoe is d carrier
Olalekan
a canal is more needed in a root but a cavity is a bad effect
Commander
what are pathogens
Don Reply
In biology, a pathogen (Greek: πάθος pathos "suffering", "passion" and -γενής -genēs "producer of") in the oldest and broadest sense, is anything that can produce disease. A pathogen may also be referred to as an infectious agent, or simply a germ. The term pathogen came into use in the 1880s.[1][2
Zainab
A virus
Commander
Definition of respiration
Muhsin Reply
respiration is the process in which we breath in oxygen and breath out carbon dioxide
Achor
how are lungs work
Commander
where does digestion begins
Achiri Reply
in the mouth
EZEKIEL
what are the functions of follicle stimulating harmones?
Rashima Reply
stimulates the follicle to release the mature ovum into the oviduct
Davonte
what are the functions of Endocrine and pituitary gland
Chinaza
endocrine secrete hormone and regulate body process
Achor
while pituitary gland is an example of endocrine system and it's found in the Brain
Achor
what's biology?
Egbodo Reply
Biology is the study of living organisms, divided into many specialized field that cover their morphology, physiology,anatomy, behaviour,origin and distribution.
Lisah
biology is the study of life.
Alfreda
Biology is the study of how living organisms live and survive in a specific environment
Sifune
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Teaching and classroom laboratories based on the “ez430” and "experimenter's board" msp430 microcontroller platforms and code composer essentials. OpenStax CNX. May 19, 2009 Download for free at http://cnx.org/content/col10706/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Teaching and classroom laboratories based on the “ez430” and "experimenter's board" msp430 microcontroller platforms and code composer essentials' conversation and receive update notifications?

Ask