<< Chapter < Page Chapter >> Page >

Timer_A ISR begins by activating LED2, indicating the beginning of execution of the routine and then switches LED1 state. The counters are updated in cascade and their contents are used to update the LCD, through the routines LCD_msec() , LCD_sec() and LCD_min() . The routine ends by switching the state of the clock separation points. Finally, LED2 is turned off.

System configuration

Watchdog timer

The Watchdog Timer is disabled with the objective of reducing energy consumption, but giving up the protection afforded by it. This peripheral is configured by the WDTCTL register. Its access is protected by a password. The value to disable it:

WDTCTL = WDTPW | WDTHOLD; // Stop WDT

Fll+ configuration

A 32.768 kHz crystal is applied to the oscillator LFXT1. Since it is possible to select the internal capacitors using software, what is the value to write to the FLL_CTL0 configuration register to select the 8 pF capacitors?

FLL_CTL0 |= XCAP18PF; // Set load cap for 32k xtal

Led ports configuration

LED1 and LED2 are connected to ports P2.2 and P2.1 respectively. How should they be configured so that just the bits related to these ports have digital output functions?

P2DIR |= 0x06; // P2.2 and P2.1 as output

How should the P2OUT register be configured so that the application starts with LED1 on and LED2 off?

P2OUT |= 0x04; // LED1 on and LED2 off

Timer_a configuration

The Timer_A is configured to count until it reaches the value written in the TACCR0 unit. An interrupt is generated when it reaches that value. Which is the interrupt vector to use? ____________

Timer_A clock signal is the ACLK without division. What is the value to write in the configuration register?

TACTL = TASSEL_1 | MC_1 | ID_0; // ACLK, up mode

The TACCR0 capture/compare unit determines the Timer_A counting range. For a 100 msec response, what is the value to write in the register?

TACCR0 = 3268; // this count corresponds to 100 msec

The interrupt is configured in TACCR0 capture/compare unit. What is the value to write to the following register?

TACCTL0 = CCIE; // TACCR0 interrupt enabled //*********************************************************// Timer A ISR //*********************************************************#pragma vector=TIMERA0_VECTOR __interrupt void TimerA0_ISR (void){ P2OUT |=0x02; // LED1 turn onP2OUT ^=0x04; // LED2 tooglemsec++; LCD_msec();if (msec == 10){ msec = 0;sec++; LCD_sec();if (sec == 60) {sec = 0; min++;LCD_min(); if (min == 60){ min = 0;} }}if (sec&0x01) // toogle clock dots {P3_DOT_ON; P5_DOT_ON;} else{ P3_DOT_OFF;P5_DOT_OFF; }P2OUT&=~ 02; // LED1 turn off }

Low power mode

BIS_SR(LPM3_bits + GIE); // LPM3 with interrupts enable

Analysis of operation

Isr execution time

Performing similar procedures to those described in laboratory Timers: Lab1 - Memory clock with Basic Timer1 measure the ISR execution time. What is the value measured?

LCD refresh: ______

The LCD write routines were changed. Taking advantage of storing the data in the BCD format, the division operation can be ignored, resulting in the reduction of execution time of the Basic Timer1 ISR. Is the processing time required to refresh the LCD constant? _____

Measurement of electrical current drawn

The power consumption was discussed in the previous point. The electrical power required by the system during operation is measured by replacing the jumper on the Header PWR1 by an ammeter, which indicates the electric current taken by device during operation.

What is the value read? __________

This example and many others are available on the MSP430 Teaching ROM.

Request this ROM, and our other Teaching Materials here (External Link)

Questions & Answers

what is phylogeny
Odigie Reply
evolutionary history and relationship of an organism or group of organisms
AI-Robot
ok
Deng
what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
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