The usual way to accomplish a long-time timer is
Setup an interrupt-generating short-time timer (like 10 to 100ms)
At each interrupt increase a counter (can be a 32-bit global var)
in main()-loop check counter for exceeding a given value
At start of time set counter to a pre-defined value
At each interrupt decrease the counter (can be a 32-bit global var)
in main()-loop check counter for expiring.
1 of 1 people found this helpful
You could also use RTC derived one pulse per second interrupt, from
the TRM -
Real Time Clock
One of the major uses of the kHzECO oscillator is for RTC
implementation. The block level illustration of the RTC
implementation is shown in Figure 14-7.
The RTC timing is derived from the 32 kHz external crystal
oscillator, as shown in Figure 14-7. Therefore, for the functioning
of the RTC, the 32 kHz external crystal must be
enabled through the register SLOWCLK_X32_CR . The
generated 32 kHz is divided to achieve a one pulse per second.
The register PM_TW_CFG2 enables one pulse per
By enabling the bit PM_TW_CFG2, the RTC generates
an interrupt every second. The interrupt is routed through
the DSI and is brought out as an interrupt. See the UDB
Array and Digital System Interconnect chapter on page 221
for more details on usage. RTC functionality is available for
use in all power modes except the Hibernate mode.
Looks like you can use this HW feature w/o having to place
RTC module. See PM_TW_CFG2 register information in
PSOC 3 register TRM.