资源简介
基于DSP TMS320F2812编写的时钟程序
代码片段和文件信息
#include “DSP281x_Device.h“ // DSP281x头文件
int timeR[6]={000000};
unsigned int LEDCode[30]={0xc0000xf9000xA4000xB0000x99000x92000x82000xF800
0x80000x90000x88000x83000xc6000xa1000x86000x8e00
0x8c000xbf000xa7000xff000x40000x79000x24000x3000
0x19000x12000x02000x78000x00000x1000};
void InitPll(void)
{ int i;
EALLOW;
SysCtrlRegs.PLLCR.bit.DIV = 10;//SYSCLK = 外部振荡频率 * PLLCR /2
EDIS;
for(i= 0; i< ( (131072/2)/12 ); i++) {;}
}
void InitPeripheralClocks(void)
{ EALLOW;
SysCtrlRegs.HISPCP.all = 1; // HISPCLK= SYSCLK * HISPCP /2
SysCtrlRegs.LOSPCP.all = 2; // LOSPCLK= SYSCLK * LOSPCP /2
SysCtrlRegs.PCLKCR.all = 0x0100;// 开启部分外设
EDIS;
}
void DisableDog(
评论
共有 条评论