hi everyone i kept verifying my assembly code and i still didn't get where i made a mistake,if anyone can help or guide me i would be thankful
so essentially the code must make two LEDs blinking using TMR0 interrupt routine to delay between the blinking of the two LEDs
so essentially the code must make two LEDs blinking using TMR0 interrupt routine to delay between the blinking of the two LEDs
Netwide Assembler:
LIST p=16f84
INCLUDE "p16F84.inc"
__CONFIG _CP_OFF & _PWRTE_OFF & _WDT_OFF
comp1 equ 0x0C
comp2 equ 0x0D
org 0x00
goto start
;================================================================
org 0x04
goto isr
;================================================================
isr
clrf TMR0
bcf INTCON,GIE
bcf INTCON,T0IF
decfsz comp1,1
retfie
bcf PORTB,1
bsf PORTB,2
decfsz comp2,f
retfie
bcf PORTB,2
retfie
;=============================================================
start
movlw 0x4D
movwf comp1
movlw 0xF
movwf comp2
bsf STATUS,RP0
movlw b'00000000'
movwf TRISB
movlw b'00000111'
movwf OPTION_REG
movlw b'10100000'
movwf INTCON
bcf STATUS,RP0
clrf TMR0
bsf PORTB,1
bcf PORTB,2
loop goto loop
END
Last edited by a moderator: