<< Chapter < Page Chapter >> Page >
In this lab, we will cover various timing options for the ez430 and their implementation with interrupts.

In this lab, we will cover the timing options for the ez430. The first part explains the clocking system of the processor and the options it allows while the second part covers the timers and timer interrupts available on the ez430. 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 two primary parts on the ez430 Timer A and the Watchdog timer.

Timer a

Refer to Chapter 8: Timer_A 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 Pins 3 and 4 (off of P1.1 and P1.2) of the board so that you may directly observe the output of Timer A.

Using two different channels of the Oscilloscope try to recreate parts of Figure 8-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.

Timer

Set up the timers to fire interrupts to calculate time intervals and redo the SOS problem from Lab 1 using the timer to simulate the "dot" and "dash" time intervals. There should be NO COUNTING LOOPS in your program, and your program should be entirely interrupt driven. It is possible to have each Capture Control Register to fire an interrupt once it reaches its max value. Explain how you setup Timer A to simulate each time interval.

Duty cycle

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

Set up the timer to toggle the 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 counting loops in your program, and you can use Timer A in any way you wish.

Once you get a single light to fade in and out, create another program with a function to set the LED at a certian brightness level when given atleast a 12 bit integer. For example, if I were to call LED_level(0x111) , the LED should appear very dim; if I were to call LED_level(0xFA0) , the LED should appear very bright. It may be helpful to have an extra function that initializes the Timer settings so that the use of this application is self contained. In the future, we will use this function to provide visual feedback when using other components.

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, Introduction to the texas instruments ez430. OpenStax CNX. Jun 19, 2006 Download for free at http://cnx.org/content/col10354/1.6
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Introduction to the texas instruments ez430' conversation and receive update notifications?

Ask