<< Chapter < Page Chapter >> Page >
In this lab, we will cover various timing options for the MSP430.

In this lab, we will cover the timing options for the MSP430. The first part explains the clocking system of the processor and the options it allows. The second part will cover the timers and timer interrupts available on the MSP. Each of these sections is strongly related to real time programming, but that topic will be dealt with separately in another lab. In general, a real-time application is one which responds to its inputs as fast as they happen. The microprocessor is generally expected to take less time to handle an interrupt or stimulus than the time before the next event will happen.

The timer system is broken into three primary parts on the MSP430: Timer A, Timer B, and the Watchdog timer. Timer B is larger and more versatile than Timer A. The User’s Guide and data sheet will explain the differences, but the way that the control registers configure each timer is largely the same. The watchdog timer will be covered in a module of its own. The timers are closely tied with real time applications because they govern the occurrence of the periodic functions of the processor.

Timer a

Refer to Chapter 11: Timer_A of the User's Guide to get a detailed description of all the options in Timer A. Basically, setting up the timers requires that you define a source for the timer and to specify a direction for the count. It may also be helpful to clear the timer register before you begin to guarantee and accurate count from the first instance. Set up Timer A in Continuous Mode and sourced from SMCLK. Set TACCR0 and TACCR1 to have two different values. Output TA0 and TA1 from header J8 of the board so that you may directly observe the output of Timer A. You may need to remove the jumpers in order to have access to these signals.

Using two different channels of the Oscilloscope try to recreate parts of Figure 11-13. Output Example- Timer in Continuous Mode . On Channel 1 show Output Mode 4: Toggle and on Channel 2 show Output Mode 6: Toggle/Set . Vary the TACCTLx in order to get as close to the orginal figure as possible. Take a screenshot of the scope and include it in your lab report.

Try this again using Timer B. This time on Channel 1 show Output Mode 4: Toggle and on Channel 2 show Output Mode 2: Toggle/Reset . Take a screenshot and submit it. What are the differences between Timer A and Timer B? What was the frequency your signals? What is the relationship between TACCTLx and the frequency?

Got questions? Get instant answers now!


Set up the timers to fire interrupts. Using the seg_count() function from lab 5 , use the timers to write a counter. The seven-segment display should display the number of seconds that have elapsed since the timer was started. Button_1 should start/stop the timer. Once the seven-segment gets to its maximum value of 15 it should roll over. There should be no for-loops in your program, and should be entirely interrupt driven. You may use Timer A or Timer B. It is possible to have each Capture Control Register to fire an interrupt once it reaches its max value. How was the timer set up to calculate one second?

Got questions? Get instant answers now!

Duty cycle

We have discussed earlier that the Duty Cycle related to the width of a pulse. If we trigger an LED with a reletively high frequency square wave, it will appear to be on constantly eventhough it is actually switching on and off quickly. As we vary the duty cycle of our trigger signal, then the LED may appear to get dimmer or brighter depending on which way we vary it.

Set up the timers to toggle an LED. Without changing the frequency of your timing pulse, change the duty cycle so that the LED appears to fade in and out. The time it takes to go from completely off to max brightness shouldn't take more than a second, then it should repeat. Once again, there should be no for-loops in your program, and you can use any combination of the timers that you wish.

Extra Credit: Once you get a single light to fade in and out, try to get all of the lights to fade asynchronously. This means that while one LED is fading out the next one should begin to fade in and so on. Good luck.

Got questions? Get instant answers now!

Questions & Answers

where we get a research paper on Nano chemistry....?
Maira Reply
what are the products of Nano chemistry?
Maira Reply
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Preparation and Applications of Nanomaterial for Drug Delivery
Hafiz Reply
Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
Jyoti Reply
I only see partial conversation and what's the question here!
Crow Reply
what about nanotechnology for water purification
RAW Reply
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
yes that's correct
I think
Nasa has use it in the 60's, copper as water purification in the moon travel.
nanocopper obvius
what is the stm
Brian Reply
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
scanning tunneling microscope
how nano science is used for hydrophobicity
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
what is differents between GO and RGO?
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
analytical skills graphene is prepared to kill any type viruses .
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
The nanotechnology is as new science, to scale nanometric
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
what school?
biomolecules are e building blocks of every organics and inorganic materials.
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, Microcontroller and embedded systems laboratory. OpenStax CNX. Feb 11, 2006 Download for free at http://cnx.org/content/col10215/1.29
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Microcontroller and embedded systems laboratory' conversation and receive update notifications?