InitializeClocks()

1,190 views
Skip to first unread message

Engrforever

unread,
Aug 30, 2010, 5:05:14 PM8/30/10
to TI Launchpad
I am using the CCS IDE and am trying to understand the below function

void InitializeClocks(void)
{

BCSCTL1 = CALBC1_1MHZ; // Set range
DCOCTL = CALDCO_1MHZ;
BCSCTL2 &= ~(DIVS_3); // SMCLK = DCO / 8 =
1MHz
}

Where are CALBC1_1MHZ and CALDCO_1MHZ defined?

I found the below lines in "msp430x20x2.h" What do the below lines do?
(SFR_8BIT)?

SFR_8BIT(CALDCO_1MHZ); /* DCOCTL Calibration
Data for 1MHz */
SFR_8BIT(CALBC1_1MHZ); /* BCSCTL1 Calibration
Data for 1MHz */

Kenneth Finnegan

unread,
Aug 30, 2010, 6:54:51 PM8/30/10
to ti-lau...@googlegroups.com
CALBC1_1MHZ and CALDCO_1MHZ are two bytes programmed in the flash at
the factory which are a calibrated value as to the VCO (voltage
controlled oscillator) of the chip. This means that when you load
those two values into the respective registers, you are using a
precalibrated setting to get appoximately 1MHz.

Kenneth Finnegan
http://kennethfinnegan.blogspot.com/

NJC MSP430 LaunchPad Blog

unread,
Aug 31, 2010, 5:57:55 AM8/31/10
to TI Launchpad
To elaborate a bit more on what CALBC1_1MHZ and CALDCO_1MHZ are; they
are addresses. These addresses point to a location in memory which
hold the values which TI put there during calibration. Beretta has an
interesting article with some good comments describing this in more
detail. I would recommend taking a look.

http://mspsci.blogspot.com/2010/07/tutorial-08-b-configuring-dco.html

Hope that helps,

NJC
________________________
http://msp430launchpad.com
Reply all
Reply to author
Forward
0 new messages