求大神帮助,M4F232关于定时器

2019-03-24 11:28发布

我在初始化的时候,只要程序执行到初始化部分时,程序就出问题,屏蔽掉初始化,程序就没问题了,
初始化函数是
void TimerInitCapCount(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2);  
SysCtlPeripheralEnable(GPIO_PORTB_BASE);      
GPIOPinTypeTimer(GPIO_PORTB_BASE,GPIO_PIN_0);
TimerConfigure(TIMER2_BASE,TIMER_CFG_16_BIT_PAIR|TIMER_CFG_A_CAP_COUNT);
TimerControlEvent(TIMER2_BASE,TIMER_A,TIMER_EVENT_NEG_EDGE);
TimerLoadSet(TIMER2_BASE,TIMER_A,40000);
TimerMatchSet(TIMER2_BASE,TIMER_A,3998);
TimerIntEnable(TIMER2_BASE,TIMER_CAPA_MATCH);
IntEnable(INT_TIMER2A);
IntMasterEnable();
TimerEnable(TIMER2_BASE,TIMER_A);
}
初始化没问题,但执行到初始化函数时就跳到下面去了
FaultISR
        B       FaultISR
;******************************************************************************
;
; This is the code that gets called when the processor receives an unexpected
; interrupt.  This simply enters an infinite loop, preserving the system state
; for examination by a debugger.
;
;******************************************************************************
IntDefaultHandler
        B       IntDefaultHandler
;******************************************************************************
;
; Make sure the end of this section is aligned. 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
4条回答
上大人孔乙己
2019-03-24 22:13
 精彩回答 2  元偷偷看……0人看过

一周热门 更多>

相关问题

    相关文章