打印
[其它应用]

SH79F1620 外部中断2

[复制链接]
1098|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
benn|  楼主 | 2013-12-10 16:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
SH79F1620 外部中断2

//-------------------------------------------------------------------------
void init_exint2(void)
{
//P0.6:INT2---input port & pull high
        P0CR &= ~BIT_6;
        P0PCR |= BIT_6;
       
        //IT3=1;//falling edge trig
        //IE0=0;
        //IPH0|=0x01;//PX0H //exint 0 interrupt priority 2
        //priority affect timer3
#if 1       
        IT20=0;
        IT21=1;//rising edge trigger
#else
        IT20=1;
        IT21=0;//falling edge trigger
#endif
        IE2=0;
//--interrupt priority
        //IPL1|=BIT_1;
        //IPH1|=BIT_1;
       
        IEN1|=BIT_1;//enable external interrupt 2
}

//-------------------------------------------------------------------------

void exint2(void) interrupt 8  //IR
{

}

中断2死活进不去,配置有问题吗?
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

10

主题

55

帖子

0

粉丝