Chapter 04 Appendix
Chapter 4 Worksheet (7)
12. (FR5969 Users only) Write the code to setup MCLK. It should be
running at 8MHz using the DCO as its oscillator source.
// Set DCO to 8MHz
CS_setDCOFreq( CS_BASE,
______________________, // Set Frequency range (DCOR)
______________________ // Set Frequency (DCOF)
);
// Set MCLK to use DCO clock source
_________________________( CS_BASE,
______________________________________________,
______________________________________________,
UCS_CLOCK_DIVIDER_1 );
CS_DCORSEL_1
CS_DCOFSEL_3
CS_clockSignalInit
CS_MCLK
CS_DCOCLK_SELECT
Chapter 4b Worksheet
1. Complete the code needed to enable the Watchdog Timer using
ACLK. (Hint: look at the WDT_A section of the DriverLib User’s Guide)
2. Write the code to ‘kick the dog’?
__________________________________( WDT_A_BASE );
// Initialize the WDT as a watchdog
WDT_A_watchdogTimerInit(
WDT_A_BASE,
____________________________; //Which clock should WDT use?
WDT_A_CLOCKDIVIDER_64 ); //Divide the WDT clock input?
//WDT_A_CLOCKDIVIDER_512 ); //Two other divisor options
//WDT_A_CLOCKDIVIDER_32K );
// Start the watchdog
__________________________________( WDT_A_BASE );
WDT_A_resetTimer
WDT_A_CLOCKSOURCE_ACLK
WDT_A_start
MSP430 Workshop - MSP430 Clocks & Initialization 4 - 63