Inside Collection (Course): Microcontroller and Embedded Systems Laboratory
Summary: In this lab, we will cover various timing options for the MSP430 and configure some more digital IO.
The following exercise will show you how to manipulate the clocking system on the MSP430. You may need to refer to the MSP430F16x Lite Development Board schematic and the User's Guide to correctly configure the clock as specified.
BCSCTL1 |= XTOFF; // XT2 = HF XTAL
do {
IFG1 = OFIFG; // Clear OSCFault flag
for (i = 0xFF; i > 0; i--); // Time for flag to set
}
while ((IFG1 & OFIFG) != 0); // OSCFault flag still set?
BCSCTL2 &= SELM0+DIVS1; // Enable fastest clocking mode
1. Using your new (fast) timer settings and your blinking light system from Lab 2 Problem 4, modify the code so that each LED remains on for a half second. Basically, generate the same behavior as the original version but using the new clock settings. What were the original (much slower) settings for the clock? What was changed in order to keep the original blink rate?
Write a program that does that following:
void led_num(int num). The function will take a number as a perameter and will use the LEDs to display this number in binary. Be sure to check for overflow. Overflow occurs when you try to represent a number greater than the number of bits available. In the case of the LEDs, you can not represent a number greater than 3 bits. What is that number? You should put all the possible values for PxOUT in an array, in order to simplify your code.
"Basic introduction to microcontroller-based embedded systems development. Includes structured laboratory exercises in the following areas: assembly programming, C language programming, peripheral […]"
"In this lab, we will cover various timing options for the MSP430 and configure some more digital IO."