关于 BCSCTL1 = CALBC1_12MHZ;DCOCTL = CALDCO_12MHZ; 的疑问
1 /************************************************************ 2 * Calibration Data in Info Mem 3 ************************************************************/ 4 5 #ifndef __DisableCalData 6 7 #define CALDCO_16MHZ_ (0x10F8u) /* DCOCTL Calibration Data for 16MHz */ 8 READ_ONLY DEFC( CALDCO_16MHZ , CALDCO_16MHZ_) 9 #define CALBC1_16MHZ_ (0x10F9u) /* BCSCTL1 Calibration Data for 16MHz */ 10 READ_ONLY DEFC( CALBC1_16MHZ , CALBC1_16MHZ_) 11 #define CALDCO_12MHZ_ (0x10FAu) /* DCOCTL Calibration Data for 12MHz */ 12 READ_ONLY DEFC( CALDCO_12MHZ , CALDCO_12MHZ_) 13 #define CALBC1_12MHZ_ (0x10FBu) /* BCSCTL1 Calibration Data for 12MHz */ 14 READ_ONLY DEFC( CALBC1_12MHZ , CALBC1_12MHZ_) 15 #define CALDCO_8MHZ_ (0x10FCu) /* DCOCTL Calibration Data for 8MHz */ 16 READ_ONLY DEFC( CALDCO_8MHZ , CALDCO_8MHZ_) 17 #define CALBC1_8MHZ_ (0x10FDu) /* BCSCTL1 Calibration Data for 8MHz */ 18 READ_ONLY DEFC( CALBC1_8MHZ , CALBC1_8MHZ_) 19 #define CALDCO_1MHZ_ (0x10FEu) /* DCOCTL Calibration Data for 1MHz */ 20 READ_ONLY DEFC( CALDCO_1MHZ , CALDCO_1MHZ_) 21 #define CALBC1_1MHZ_ (0x10FFu) /* BCSCTL1 Calibration Data for 1MHz */ 22 READ_ONLY DEFC( CALBC1_1MHZ , CALBC1_1MHZ_) 23 24 #endif /* #ifndef __DisableCalData */
SFR_8BIT(CALDCO_16MHZ);对使用宏定义的地方进行字符展开就是:extern volatile unsigned char CALDCO_16MHZ;
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.
CALBC1_1MHZ and CALDCO_1MHZ是用来设置校准值的。TI已经把他放进flash中了。
头文件中有一行字:
/************************************************************
* Calibration Data in Info Mem
************************************************************/
他的意思就是:存储在flash中的校准数据,0x10FFu 这些都是他们的地址