|
int main(void)
{
//char c;
//unsigned int i;
uint32_t sas,mmm;
//const char TXdata[]="chushihuachenggong!";
jtagWait();//·àÖ1JTAGê§D§
clockInit();//ê±Öó3õê¼»ˉ
uartInit();//UART3õê¼»ˉ
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1 );
TimerConfigure(TIMER1_BASE,TIMER_CFG_PERIODIC);
TimerLoadSet(TIMER1_BASE,TIMER_A,0xfafffaa);
TimerEnable(TIMER1_BASE, TIMER_A);
sas=TimerValueGet(TIMER1_BASE,TIMER_A);
mmm=TimerLoadGet(TIMER1_BASE,TIMER_A);
while(1)
{
UARTCharPut(UART6_BASE,(int8_t)((mmm)&0xff));
UARTCharPut(UART6_BASE,(int8_t)((mmm>>8)&0xff));
UARTCharPut(UART6_BASE,(int8_t)((mmm>>16)&0xff));
UARTCharPut(UART6_BASE,(int8_t)((mmm>>24)&0xff));
SysCtlDelay(TheSysClock/3);
UARTCharPut(UART6_BASE,(int8_t)((sas)&0xff));
UARTCharPut(UART6_BASE,(int8_t)((sas>>8)&0xff));
UARTCharPut(UART6_BASE,(int8_t)((sas>>16)&0xff));
UARTCharPut(UART6_BASE,(int8_t)((sas>>24)&0xff));
}
今天想调试一下TM4C129的定时器,然后用串口打印出装载值和定时器的当前计数值,可是发现打印出来的当前计数值是不变的一个个值,而且该值不等于装载值,很是郁闷,想向各位请教一下,问题出在哪里了?
|
|