I can't seem to find anything that explains how to use DCOCTL and BCSCTL. I'm new to embedded programming (Although I consider myself pretty good at C and C++). I'm using the MSP430 Launchpad with the external osc soldered on.
My goal is 16MHz but for now I'm aiming at a value in the datasheet:
DCO frequency (15, 3) RSELx = 15, DCOx = 3, MODx = 0 3 V 15.25 MHz
How would I go about settings this up? It looks like I have to setup DCOCTL and BCSCTLx (Why are there three?)
Looks like DCOCTL should be assigned like so:
/* DCO(15,3) is 15.25MHz */
DCOCTL |= 0xF3;
I don't really understand how to do anything with BCSCTLx as I don't understand why their are three of them, but I can assume its how I setup the internal caps and to enable the external crystal.
Edit: (I looked at these in the debugger (not sure why I didn't look at them before!)). Should it go something like this:
/* XT2OFF bit off, this should enable XT2? */
BCSCTL1 &= ~XT2OFF;
/* Set to 12.5 pF, all other settings look good? */
BCSCTL3 |= XCAP_3;