I'm a novice and I'm looking for help on a two hour delay timer for a project I'm working on. I'm using a RS08KA2 MC and it doesn't have a RTC so I've nested loops to create a long delay but it isn't very accurate. Does anyone know how to implement a long delay in the KA2 that may be easier to implement and more accurate? I've looked at AN3413 Low Cost digital timer but it ties in a ADC and I can't seem to understand the code.
Below is what I've done to get a long delay and it works but seems like a very bad way to do it. I included all the code since it's such a small program.
Any advice would be appreciated,
===================================================================================== ; Const Section ORG ROMStart ;CONFIGURES SYSTEM CONTROL ;CONFIGURES CLOCK (FEI Operation Mode)
;CONFIGURES KEYBOARD INTERRUPTS (KBI)
;******************************************************************************************* main_loop: loopRelay:
;BELOW IS THE NESTED DELAY LOOPS I USED
StartDelay: bclr 4,MTIMSC ; Start MTIM counter wait Delay2:
RelayOff |