打印
[技术问答]

想用N76E003 P1.1低电平做为外部中断源

[复制链接]
693|10
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
itv1860|  楼主 | 2019-5-13 11:24 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
想用N76E003  P1.1低电平做为外部中断源,调试好久没成功,有哪位大神指点一二的?

使用特权

评论回复
沙发
jasontu| | 2019-5-13 15:14 | 只看该作者
#include "N76E003.h"
#include "SFR_Macro.h"
#include "Function_define.h"
#include "Common.h"
#include "Delay.h"



void PinInterrupt_ISR (void) interrupt 7
{
        if(PIF == 0x02)
        {
    PIF = 0x00;                             //clear interrupt flag               
        }
       
}
/******************************************************************************
The main C function.  Program execution starts
here after stack initialization.
******************************************************************************/
void main (void)
{   
                P11_Input_Mode;

                Enable_INT_Port1;

                Enable_BIT1_LowLevel_Trig;

    set_EPI;                                                        // Enable pin interrupt

    set_EA;                                                                // global enable bit
   
while(1)
}

使用特权

评论回复
板凳
dongnanxibei| | 2019-5-14 00:40 | 只看该作者
参考楼上的,这个管脚是特别管脚吗

使用特权

评论回复
地板
dongnanxibei| | 2019-5-14 00:50 | 只看该作者

使用特权

评论回复
5
dongnanxibei| | 2019-5-14 00:54 | 只看该作者
看好上面的图。

使用特权

评论回复
6
itv1860|  楼主 | 2019-5-14 12:09 | 只看该作者

只要按下按键,就一直触发中。。。也就是一直在执行中断函数。。。。

使用特权

评论回复
评论
itv1860 2019-5-14 14:05 回复TA
好了,进入中断后,clr_EPI 执行中断函数数后set_EPI。谢谢! 
7
itv1860|  楼主 | 2019-5-14 12:10 | 只看该作者
jasontu 发表于 2019-5-13 15:14
#include "N76E003.h"
#include "SFR_Macro.h"
#include "Function_define.h"

只要按下按键,就一直触发中。。。也就是一直在执行中断函数。。。。

使用特权

评论回复
8
itv1860|  楼主 | 2019-5-14 14:06 | 只看该作者
itv1860 发表于 2019-5-14 12:10
只要按下按键,就一直触发中。。。也就是一直在执行中断函数。。。。

好了,进入中断后clr_EPI ,执行中断函数数后set_EPI。谢谢!

使用特权

评论回复
9
xinpian101| | 2019-5-14 22:10 | 只看该作者
对,进入中断后要清理标志位

使用特权

评论回复
10
xinpian101| | 2019-5-14 22:11 | 只看该作者
或者关闭中断操作。这就搞定了,楼主真棒。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

18

主题

55

帖子

0

粉丝