static void __irq T0Intseverice()
{
rGPBDAT = 0xef;//(data<<5);
}
void T0init(void)
{
pISR_TIMER0=(U32)T0Intseverice;
rINTMOD=0x0; //IRQ 模式
rINTMSK=~(BIT_TIMER0); //开中断T0
rTCFG0=0x0000FF;
rTCFG1=0x000003;
rTCON=0X09;
rTCNTB0=0Xf0;
rTCMPB0=0X0f;
}
int Main(int argc, char **argv)
{
int i;
U8 key;
U32 mpll_val=0;
T0init();
mpll_val = (92<<12)|(1<<4)|(1);
ChangeMPllValue((mpll_val>>12)&0xff, (mpll_val>>4)&0x3f, mpll_val&3);
ChangeClockDivider(key, 12);
MMU_DisableICache();
MMU_DisableDCache();
rGPBCON = 0x155555;
rGPBDAT = 0x00;
while(1)
{; }
return 0;
}
我是刚学的还请各位不吝赐教,谢谢~ |