LPC1114_Timer16_0中断程序_MDK编译环境
LPC_SYSCON->SYSAHBCLKCTRL |= (1<7); //开启定时器时钟
LPC_TMR16B0->PR=1000;//1000-1; //预分频计数器
LPC_TMR16B0->MR0=12000; //匹配寄存器
LPC_TMR16B0->TCR=0x1; //开启定时器计数器
LPC_TMR16B0->MCR=3;//(1<0)&(1<1); //匹配控制--匹配则引发中断并复位定时器
NVIC_EnableIRQ(TIMER_16_0_IRQn); //中断使能
Timer16_0中断程序:
void TIMER16_0_IRQHandler(void)
{
if ( LPC_TMR16B0->IR & 0x1 )
{
LPC_TMR16B0->IR = 1; /* clear interrupt flag */
//timer16_0_counter++;
GPIOSetValue( 0, 3, 0 ); //给P0.3位写0
Delay_Ms(100);
GPIOSetValue( 0, 3, 1 ); //给P0.3位写0
Delay_Ms(100);
}
if ( LPC_TMR16B0->IR & (0x1<4) )
{
LPC_TMR16B0->IR = 0x1<4; /* clear interrupt flag */
timer16_0_capture++;
}
return;
}
LPC1114中断程序MDK编译环 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)