Hello,
My customer is trying to set the fCPU to 16MHz. But their firmware freezes right after "DCOCTL = CALDCO_16MHZ;".
My customer code is:
(CPU RESET)
...
BCSCTL1 = CALBC1_16MHZ;
DCOCTL = CALDCO_16MHZ; // >>> Freeze right after thi line.
So, could you please give us a initializaiton procedure to set fCPU=16MHz ?
My idea would be:
(CPU RESET)
...
BCSCTL1 = 7; // Errata BCL12 requires RSEL=7 during DCOCTL change.
DCOCTL = CALDCO_16MHZ;
BCSCTL1 = CALBC1_16MHZ;
I tried to write my idea, but I have the following concerns:
- Some sample codes shows "3-step clock startup sequence", but I'm not sure it is true for 16MHz. Especially, I'm afraid DCOCTL=0 is harmful. It should be 7.:
from [msp430x21x2_clks.c]
DCOCTL = 0; // Select lowest DCOx and MODx settings
BCSCTL1 = CALBC1_8MHZ; // Set DCO to 8MHz
DCOCTL = CALDCO_8MHZ;
To say strictly, my customer question was "how to set RSEL=15". I translated it to fPU=16MHz, but I'm not sure it is completely the same or not.