SphinX
Advanced Member level 3
how to trace source code on proteus
Hi All,
I have started to learn proteus.
I wrote a simple program to make a delay of approx. 100uS
using interupt.
' Xtal= 12Mhz
Org 0000
sjmp start
Org 0bh
sjmp inter
start:
mov p1,#0
mov IE,#10000010b 'Enable interupt on Timer 0 overflow
mov TMOD,#00000010b 'Choose Timer0 Reload mode
mov TH0,#155 'Make the timer start from 155 (255-155=100us)
mov TL0,#155
SETB TR0 'Run the timer
SETB p1.0
loop: sjmp loop
inter: 'Interupt service
cpl p1.0 'Toggle p1.0
reti
END
I simulated this program using proteus, it worked good
I attatched a LogicAnalyzer to the circuit in the proteus
it give correct results.
But when i executed the debuger in proteus and start to trace into
the code (F11) i noticed that it not execute the interrupt after
the timer0 overflow and the p1.0 not change although it have worked
done in simulation !
What is the bug ?
Thanks
Hi All,
I have started to learn proteus.
I wrote a simple program to make a delay of approx. 100uS
using interupt.
' Xtal= 12Mhz
Org 0000
sjmp start
Org 0bh
sjmp inter
start:
mov p1,#0
mov IE,#10000010b 'Enable interupt on Timer 0 overflow
mov TMOD,#00000010b 'Choose Timer0 Reload mode
mov TH0,#155 'Make the timer start from 155 (255-155=100us)
mov TL0,#155
SETB TR0 'Run the timer
SETB p1.0
loop: sjmp loop
inter: 'Interupt service
cpl p1.0 'Toggle p1.0
reti
END
I simulated this program using proteus, it worked good
I attatched a LogicAnalyzer to the circuit in the proteus
it give correct results.
But when i executed the debuger in proteus and start to trace into
the code (F11) i noticed that it not execute the interrupt after
the timer0 overflow and the p1.0 not change although it have worked
done in simulation !
What is the bug ?
Thanks