求教:关于PIC的问题:不能清除中断标志位

2020-02-09 11:37发布

问一个关于PIC的问题,PIC16F72,我用PROTEUS VSM在MPLAB里仿真,因为没有F72,就用C72代替,编译器是Hi-tech,

问题是这样的,我先使能了RB中断,在使能全局中断之前,执行了一次 RBIF = 0;,清除中断标志,但是从Watch Windows里看INTCON,RBIF却没有被清除掉,仍然是1,所以一开GIE就进了中断,这是怎么回事?
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
9条回答
zengxy
2020-02-10 11:12
上拉是有的,确实没有读,

这是官方的回答,看来确实是没有读的问题:

Problem Resolution:
Hi,
You can use MPLAB SM tool to simulate interrupt-on-change function on PORTB.
The user, in the interrupt service routine can clear the interrupt in the following manner:
a) Any read or write of PORTB. This will end the mismatch condition.
b) Clear flag bit RBIF.

一周热门 更多>