Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 3 > how make 90 seconds timer

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



how make 90 seconds timer
Moderator:
RKRM

Post Reply
Follow this topic



how make 90 seconds timer

rteg posted on 24 Feb 2013 12:56 AM PST
Member
8 Forum Posts

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




Re: how make 90 seconds timer

Bob Marlowe posted on 24 Feb 2013 01:42 AM PST
Top Contributor
1768 Forum Posts

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



Re: how make 90 seconds timer

danaaknight posted on 24 Feb 2013 02:53 AM PST
Top Contributor
1773 Forum Posts

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.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20