Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
inc MyCounter
reti
mov P1,MyCounter
;-------------------------------------------------------------------------
CSEG AT RESET
jmp MainProg ;Main loop
CSEG AT EXTI0
jmp intP32 ;ISR for P3.2
;-------------------------------------------------------------------------
;ISR for pin P3.2
;
RSEG intP32
inc MyCounter
reti
;-------------------------------------------------------------------------
;Main loop
;
RSEG MainProg
mov sp,#Stack-1 ;initialize stack
mov R0,#0FFh ;clear internal RAM
clr a
LBL_ClearRAM: mov @R0,a
djnz R0,LBL_ClearRAM
setb IT0 ;Interrupt P3.2 edge sensitive
setb EX0 ;Enable interrupt pin INT0 P3.2
setb EA ;Enable all interrupts
LBL_Loop: mov P2,MyCounter ;Value to port 2
jmp LBL_Loop