<< Chapter < Page Chapter >> Page >

When the SD16_A ends the conversion, an interrupt is requested. While variable min is lower than 60, the temperature is written in flash memory. The memory pointer is increased by two (word). When min = 60, the system stops operation.

System configuration

Dco configuration

Adjust the DCO frequency to 1 MHz by software using the calibrated DCOCTL and BCSCTL1 register settings stored in information memory segment A.

if (CALBC1_1MHZ == 0xFF || CALDCO_1MHZ == 0xFF) {while(1); // If calibration constants erased // do not load, trap CPU!!} DCOCTL = CALDCO_1MHZ; // Set DCO to 1 MHz

Basic clock module+ configuration

Set MCLK and SMCLK to 1 MHz. Use the internal very low power VLOCLK source clock to ACLK/8 clock signal as low frequency oscillator (12 kHz):

BCSCTL1 = DIVA_3; // ACLK = 1.5 kHz BCSCTL3 = LFXT1S_2; // Set VLOCLK (12 kHz)

Sd16_a configuration

The SD16_A’s input channel is the integrated temperature sensor (A6) and it uses the signal V REF+ (1.2 V) as reference voltage. The SD16_A clock source is SMCLK. Configure the SD16_A to perform a single conversion and enable its interrupts. What are the values to write to the configuration registers?

SD16CTL = SD16REFON + SD16SSEL_1; // 1.2V ref, SMCLK SD16INCTL0 = SD16INCH_6; // Temp. sensor: A6+/-SD16CCTL0 = SD16SNGL + SD16IE; // Single conv, int. enable //********************************************************* // SD16_A Interrupt Service Routine//********************************************************* #pragma vector=SD16_VECTOR__interrupt void SD16ISR(void) {unsigned int temperature; if (min<= 60) {temperature = (SD16MEM0-0x8000)/84 - 232; write_int_flash(memo_ptr,temperature);memo_ptr += 2; }else {_NOP(); }}

Timer_a configuration

Configure Timer_A register to enable an interrupt once every second. Use the ACLK clock signal as the clock source. This timer is configured in up mode in order to count until the TAR value reaches the TACCR0 value.

TACCTL0 = CCIE; // CCR0 interrupt enabled~ TACCR0 = 1500; // this count corresponds to 1 secTACTL = TASSEL_1 | MC_1 | ID_0; // ACLK, up mode to CCR0 //********************************************************* // Timer_A Interrupt Service Routine//********************************************************* #pragma vector=TIMERA0_VECTOR__interrupt void TimerA0_ISR (void) {counter++; P1OUT ^= 0x01; // LED toogle if (counter == 60) {min++; counter = 0;SD16CCTL0 |= SD16SC; // Start SD16 conversion }}

Analysis of operation

Measure the temperature variation over 1 hour

After compiling the project and starting the debug session, before running the application, put a breakpoint at line of code with the _NOP() instruction. Go to breakpoint properties and set action to Write data to file. Name the file as Temp.dat and define the data format as integer. The data starts at address 0x01040 with a length of 3C . Run the application and let the temperature data logger acquire the values over 1 hour. Use a heater or a fan to force temperature variations during the measurement period. When execution reaches the breakpoint, the file will be available in your file system. Construct a graph using Excel or a similar tool, to plot the temperature variation obtained by the data logger.

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

the diagram of the digestive system
Assiatu Reply
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 environments
AI-Robot
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
cell is the building block of life.
Condoleezza Reply
what is cell divisoin?
Aron Reply
Diversity of living thing
ISCONT
what is cell division
Aron Reply
Cell division is the process by which a single cell divides into two or more daughter cells. It is a fundamental process in all living organisms and is essential for growth, development, and reproduction. Cell division can occur through either mitosis or meiosis.
AI-Robot
What is life?
Allison Reply
life is defined as any system capable of performing functions such as eating, metabolizing,excreting,breathing,moving,Growing,reproducing,and responding to external stimuli.
Mohamed
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