Message me off-list.
hello Melanie
i have some questions
1- i did not understand yet why did you used calibration? and what is that for ? all what i understood it that
you used to speed up or down, but i could not understand it why ?
2- all i know, the Disable i use it before interrupt routine and Enable after it, but i note you used it at different place
why did you placed at these places ?
Enable
DisplayLoop:
if ButStart=0 then runningflag=1
if butstop=0 then runningflag=0
lcdout $fe,$80,Dec2 hours,":", dec2 Minutes,":", dec2 seconds,":",dec2 Hundredths
if overflowerror=1 then
if seconds.0=1 then
lcdout $fe,$8c,"ERR"
else
lcdout $fe,$8c," "
endif
endif
if runningflag=1 then goto Displayloop
if butreset=1 then goto Displayloop
Disable
Calibration
With the best intentions in the world, a 4MHz Clock is NOT a 4MHz clock. It is a few Hz fast, or a few Hz slow, but is is NOT exactly 4000000.0000Hz. so the Calibration feature is used to speed-up or slow-down the clock slightly to compensate, and to compensate any lag in software instructions used to service the interrupt.
Interrupt ENABLE
I only ENABLE interrupts where they are needed. In other places they are either not needed, or not wanted. This also makes for smaller and more efficient code.
so put some codes between Disable and Enable, that will delay interrupt
handler rountine for few times?? and use that trick if i want to finish some
procedures, i fear if without it the interrupt could screw it up ?then for that i give some
delay to interrupt to finish that procedure?
Disable
Enable
Bookmarks