emperror123
Member level 5
as i understand the question is mean they have active low switch connected to RB3 and when it is pressed, active high led will on for 1 second, in between 1 sec, any switch press will not happen anything. 2nd is LED in RA1 will on / off 0.25second will be in ISR. both use RC oscillator and 800kHz
below are my coding
i am just learn from it, but still not familiar with it, just would like to ask how should i modified it. thank and ur help is much appreciated
below are my coding
Code:
#include p16f84a.inc
D3 equ 21
D2 equ 22
D1 equ 23
org 00
goto start
org 04
goto int_routine
start bsf STATUS, 5
movlw B'00000000'
movwf TRISA
movlw B'00001000'
movwf TRISB
movlw B'00000000'
movwf OPTION_REG
bcf STATUS, 5
switch btfsc PORTB, 4
bsf PORTB, 3
call delay2
bcf PORTB, 3
goto switch
int_routine
LED
bsf PORTA, 1
call delay2
bcf PORTA, 1
call delay2
goto LED
delay1 movlw D'20'
movwf D3
movlw D'36'
movwf D2
movlw D'45'
movwf D1
decfsz D1
goto $ - 1
decfsz D2
goto $ - 5
decfsz D3
goto $ - 9
return
delay2 movlw D'10'
movwf D3
movlw D'25'
movwf D2
movlw D'32'
movwf D1
decfsz D1
goto $ - 1
decfsz D2
goto $ - 5
decfsz D3
goto $ - 9
return
end
i am just learn from it, but still not familiar with it, just would like to ask how should i modified it. thank and ur help is much appreciated
Last edited: