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
Help with what?
You did select the Keil tools because of the great simulator, allowing you to slow down everything while debugging a simulated processor?
Or you selected Keil because of availability of a forum to debug the code?
Exactly where are you stuck? And what have you tried to do to get unstuck?
this is so basic OR you retyped your code which is a BIG mistake since you may introduce errors or corrections that do not exist in your code.
try to find out how main: get executed
Erik
PS I would never call the entry in an asm program main
the prblm is that prgram gets stuck in the JZ loop and interrupt is not recognized i tried simulating and thats what happens i want to knw is the program correct.
If it gets stuck and nothing happens, while you expect something to happen, then the program isn't correct.