DOZE period

Period - is a variable/constant which determines the duration of the reduced- power sleep (peripherals active).


Doze for a short period.

Power consumption is reduced, but some timing accuracy is lost. Doze uses the same timeout frequency as sleep (2.1s). The doze command puts the microcontroller into low power mode for a short period of time (like the sleep command). However, unlike the sleep command, all timers are left on and so the pwmout, timer and servo commands will continue to function. The nominal period of time is 2.1 seconds.

Due to tolerances in the microcontrollers internal timers, this time is subject to -50% to +100% tolerance. The external temperature affects these tolerances and so no design that requires an accurate time base should use this command. 'doze 0' puts the microcontroller into permanent doze - it does not wake every 2.1 seconds. The microcontroller is only woken by a hardware interrupt (e.g. hint pin change or timer tick) or hard-reset. The chip will not respond to new program downloads when in permanent doze.

Effect of increased clock speed

The doze command uses the internal timer which is not affected by changes in resonator clock speed.

Applies To:
20X2, 28X2, 40X2
See Also:
Related Create:

    Flash an LED

    Flash an LED while conserving power

    Code Example:
    main:	high B.1	; switch on output B.1
    	doze 1		; doze for 2.1 s
    	low B.1		; switch off output B.1
    	doze 1		; doze for 2.1 s
    	goto main	; loop back to start
    Copy Code Submit an Example

    Submit Your Own Code!

    You must be logged in to submit code examples. Login now.


    • Login to leave a comment.