(Optional) Lab 4c – Using Crystal Oscillators
Note: In our solution, we connected all four pins using the
GPIO_setAsPeripheralModuleFunctionInputPin(). We found this done two
different ways in two different examples. One example was similar to ours, the other set
the IN pins with the ‘InputPin’ function, while the setting the OUT pins using the
GPIO_setAsPeripheralModuleFunctionOutputPins() function. We found that
either of these solutions works. We chose the solution with less typing.
9. Build and launch the debugger.
10. Set three breakpoints in the myClocksWithCrystals.c file.
Set a breakpoint after each instance of the code where we read the clock settings.
For example:
11. Run the code (click ‘Resume’) three times and record the clock settings:
Expression Default Settings First setup Second setup
myACLK/1024
mySMCLK/1024
myMCLK/1024
Why didn’t SMCLK get set correctly on the first setup? We setup SMCLK to use XT2CLK, but
it didn’t’ seem to take:
_________________________________________________________________________
_________________________________________________________________________
Hint: Read the comments on the code itself. We hope that’ll explain what caused this.
12. When done experimenting with this code, terminate the debugger and close the
project.
MSP430 Workshop - MSP430 Clocks & Initialization 4 - 59