zhaniko93
New Member
Code:
LIST P=16F628A, R=DEC ; Use the PIC16F628 and decimal system
#include "P16F628A.INC" ; Include header file
__config _INTRC_OSC_NOCLKOUT & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON & _MCLRE_OFF
errorlevel -302
goto Start
org 0x4
bcf INTCON, RBIF
retfie
Start movlw 7
movwf CMCON
bsf INTCON, RBIE
bsf INTCON, GIE
clrf PORTA
clrf PORTB
banksel TRISA
movlw b'11110000' ; RB3(PWM)=0
movwf TRISB
banksel PORTA
nop
goto $-1
END
when simulating in osohsoft Pic simulator IDE,everything goes fine untill I put PORTB, 7 port on 1, interrupt happens and then after retfie, interrupt happens again! and again, and again in spite of I change from 1 to 0 or not, why?
Last edited: