需要配置Config1,Config2寄存器。
我的是:
CONFIG2=0x0b; //Bit 3:Enable CAN, Bit 2 isable extra divide-by-128 prescaler in timebase module
//Bit 0:Internal data bus clock used as clock source for SCI
CONFIG1=0x3b;//0x4b;//LVI disable, COP disable
PCTL=0x00; // PLL,(用4M晶振产生8M总线频率)
PBWC=0x80 CTL=0x02 MS=8 MRS=0x70 BWC_ACQ=1 CTL_PLLON=1;while(!PBWC_LOCK) CTL_BCS=1;
// SCBR = 0x02; // Select 9600 Baud rate over a clock = 2.4576 MHz
SCBR = 0x30; //当总线频率8M,用此语句
SCC1 = 0x40;SCC2 = 0x08;SCS1;
|