PIC32MX795F512L单片机Timer1中断问题
时间:10-02
整理:3721RD
点击:
各位大神有谁玩过PIC32MX795F512L单片机的;麻烦帮我看一下下面的程序;Timer1进不了中断怎么回事?请赐教。
#define TIME_ON 15
#define TCKPS_0 4
#define TCKPS_1 5
#define PERIOD_100us 0x3E8
#define T1IE 4
#define T1IF 4
#define MVEC 12
Timer1 配置如下:
PR1=PERIOD_100us;//Period Time=100us
IEC0|=Bit(T1IE);//Enable Timer1 interrupt
IPC1|=Bit(3);//Priority Level;2(010)
INTCON|=Bit(MVEC);//Enable Multiple Vector
T1CON|=(Bit(TIME_ON)|Bit(TCKPS_0));//Timer1 ON;1;8 Prescale Value
中断函数如下:
void __ISR(_TIMER_1_VECTOR,IPL2) Timer1Handler(void)
{
}
补充说明:MPLAB X IDE v3.05;x32编译器;
#define TIME_ON 15
#define TCKPS_0 4
#define TCKPS_1 5
#define PERIOD_100us 0x3E8
#define T1IE 4
#define T1IF 4
#define MVEC 12
Timer1 配置如下:
PR1=PERIOD_100us;//Period Time=100us
IEC0|=Bit(T1IE);//Enable Timer1 interrupt
IPC1|=Bit(3);//Priority Level;2(010)
INTCON|=Bit(MVEC);//Enable Multiple Vector
T1CON|=(Bit(TIME_ON)|Bit(TCKPS_0));//Timer1 ON;1;8 Prescale Value
中断函数如下:
void __ISR(_TIMER_1_VECTOR,IPL2) Timer1Handler(void)
{
}
补充说明:MPLAB X IDE v3.05;x32编译器;
6
好东西