We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
i am using interrupt program to count the number of blocks passing through a sensor on each passing i use the sensor signal as an interrupt and increament the value. on passing of a specified number of blocks i want a change in LEDs connected. Can anyone help me with the program i have written in assembly language and am using 89C52 in this program i want 8 blocks to pass before led changes.
the program is as follows: ORG 000H SJMP LABEL ORG 003H ACALL ISR RETI
MAIN: MOV R3,8d SETB IP.0 SETB TCON.0 SETB IE.0 SETB IE.7 MOV A,#00000001B ABC: JZ R3,LABEL SJMP ABC LABEL: CPL A MOV P1,A JMP ABC
ISR: CALL DELAY DEC R3 DELAY: MOV R2,#42d MOV R1,#12h MOV R0,#43h loop: DJNZ R0,loop DJNZ R1,loop RET END