Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 3 > AN54460 - PSoC® 3 and PSoC 5 Interrupts

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



AN54460 - PSoC® 3 and PSoC 5 Interrupts
Moderator:
RKRM

Post Reply
Follow this topic



AN54460 - PSoC® 3 and PSoC 5 Interrupts

PeterT posted on 21 May 2012 9:46 AM PST
Member
10 Forum Posts

 This is a very good app note and recommend anyone who uses interrupts in their project to read it.

The Interrupt Type parameter of the interrupt component seems a little misleading to me.  It appeared to me that setting it to "derived" was sort of an "auto" setting where the builder would automatically select either edge or level triggering as appropriate.  According to this app note, that is completely incorrect and that, for example, if I set my interrupt to "derived" that is based on my UART, it won't even work.  I'm glad that this app note clarifies this issue, but I think that it would be very helpful to reword the descriptions when setting the interrupt type in the component parameter window or even call the "derived" option something else like "fixed-function".

In the "My First Interrupt Project" example, i noticed that the global variable was not declared as "volatile".  Should not any variable that is being accessed by more than one process be "volatile"?




Re: AN54460 - PSoC® 3 and PSoC 5 Interrupts

Bob Marlowe posted on 21 May 2012 10:34 AM PST
Top Contributor
1768 Forum Posts

The storage-class "voilatile" tells the compiler to skip optimizations for this variable, because it may change its value from the outside (as pin-variables frequently do) This often happens when within a loop a variable is "read" (its value stored into another var, tested etc.) and the compiler comes to the conclusion that this access can be optimized-out which means that the access is not performed within the loop but once before the loop starts (which is not always what the programmer (we) would like to have).

Not only variables which are accessed concurrently from different processes/threads do need to have the special storage-class voilatile, but functiond accessed from different processes/threads must be declared as "reentrant" additionally, especially in the world of PSoC3 due to the limitations the 8051 processor comes with.

Bob






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