- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,
how to make a 90 seconds timer ,i.e after 90 seconds it must enable a ADC, here ADC is started by Hardware triggered by the 90 seconds timer .
Thanks
Solved! Go to Solution.
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
or
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.
Happy times
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
or
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.
Happy times
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 [0]. The
generated 32 kHz is divided to achieve a one pulse per second.
The register PM_TW_CFG2[4] enables one pulse per
second functionality.
By enabling the bit PM_TW_CFG2[5], 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.
Regards, Dana.