You create very long pauses by repeating shorter pauses. At 80MHz, the system clock (CNT) rolls over about every 50 seconds. I would suggest creating a 1 second clock using a WAITCNT( CLKFREQ + CNT). By repeating this 60 times, you get a 1 minute clock. By repeating that 60 times, you get a 1 hour clock, etc. The WAITCNT operation and the REPEATs take only a few microseconds to execute, so this overhead is a very small portion of the execution time that can even be corrected like this:
You can also use an external real time clock with an alarm output connected to a Propeller I/O pin, set an alarm for 24 hours or more ahead, and use WAITPEQ or WAITPNE to have the Propeller wait until the alarm output becomes active which will cause the wait to terminate. If you want, you can switch the Propeller to use the slow (32KHz) built-in RC clock before doing the wait. That will reduce the power consumption of the Propeller even further than when all cogs are waiting for something or stopped.
Comments