Lab 4a – Program the MSP430 Clocks
Extra Credit (i.e. Optional Step) – Change the Rate of Blinking
20. Halt the processor and terminate the debugger session.
21. Add a function call to initClocks() to force MCLK to use the REFO oscillator.
We suggest that you copy/paste the
function that sets up ACLK… then
change the ACLK parameter to
MCLK.
Our code sets up MCLK (via the
UCS_initFLLSettle() function) then
changes it again right away … but
that’s OK. No harm done.
22. Build your code and launch the debugger.
23. Run the code, stopping at both breakpoints.
Did the value for MCLK change? _______________________________________________
It should be much slower now that it’s running from REFO.
24. After the second breakpoint, watch the blinking light.
When the code leaves the initClocks() function and starts executing the while{} loop, it should
take a very looooooong time to run the _delay_cycles() functions; our “ONE_SECOND” time
was based upon a very fast clock, not one this slow.
If you’re patient enough, you should see the light blink…
MSP430 Workshop - MSP430 Clocks & Initialization 4 - 53