Clock Configuration
One of the first aspects of a startup process is CPU clock configuration. Usually, a microcontroller would have an internal "RC" oscillator, which is referenced in the diagram below as an IRC. This internal oscillator allows the CPU to boot before the application code can switch to another clock source if desired.
Exercise
Note that because you will be altering the clock source, your UART driver which is used to output printf() data may not work.
- OSC clock
- Verify if you have an external oscillator installed on your board
- Switch the CLCKSEL[8] to switch to SYSCLK
- Modify CLKSRCSEL[0] to switch to OSC clock
- Validate that you are able to execute code by blinking an LED
- Revert your changes from the previous part to complete this part
- Divide the Peripheral clock 2 using PCLKSEL[4:0]
- Use 38400 in webserial application and check what is output when you hit RESET on your board
- Slow down the webserial communication rate by 2 (ie: 19200 vs. 38400)
- Validate that you are able to see the printf() output
- Explain your observations
- Try setting the CCLKSEL[4:0] to 0
- Is your LED still blinking?
- Explain your results