Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > a simple tutorial on interrupts

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



a simple tutorial on interrupts
Moderator:
ANCY

Post Reply
Follow this topic



a simple tutorial on interrupts

mahmoud posted on 02 Mar 2013 10:34 AM PST
Top Contributor
67 Forum Posts

 hi can anyone give me a very simple tutorial on intterupts in PSOC5... I already have some idea of intterupts in mbed LPC1768 but I just want to be sure about the differences between the two.

 

the link to the mbed interrupt tutorial: http://mbed.org/users/AjK/notebook/regarding-interrupts-use-and-blocking/




Re: a simple tutorial on interrupts

mahmoud posted on 02 Mar 2013 10:36 AM PST
Top Contributor
67 Forum Posts

 also is there a place where I could simply learn the C programming of the ARM CORTEX M3..... I can't seem to find it anywhere on the site.



Re: a simple tutorial on interrupts

Bob Marlowe posted on 02 Mar 2013 11:12 AM PST
Top Contributor
1768 Forum Posts

There is nothing special about C for an ARM processor, the interesting thing about C is that you may use the very same code on a PSoC3 with an 8051 core and on a PSoC5 with an ARM core without modifications. The only fact you have to care for is a different endianess of the cores.

As for the way the PSoC IDE works: there are a lot of different components which are placed onto a schematic, properties set and finally routed to each other. One of the components is an interrupt which can be wired to any internal or external signal (with a selectable edge or level trigger).

What you will have to learn are the APIs of the components you use to have progammable access to its functionality.

To learn more about there is a large bunch of videos explaining PSoCs http://video.cypress.com/video-library/video/PSoC search for PSoC5 relevant themes and enjoy.

 

Happy coding

Bob



Re: a simple tutorial on interrupts

mahmoud posted on 02 Mar 2013 11:15 AM PST
Top Contributor
67 Forum Posts

 hahahahaha so u are actually saying that the countless hours spent by embedded engineers learning and teaching interruptes can be summarized in a single PSOC5 block ...... that's cool .

 



Re: a simple tutorial on interrupts

danaaknight posted on 02 Mar 2013 11:50 AM PST
Top Contributor
1773 Forum Posts

Not exactly.

 

If you are manipulating HW, using HW generated interrupts, then you

still have to be cognizant at the register and controller level how machine

handles them. The ISR Bob is speaking of is a generic schematic symbol

that you can attach to various logic signals and have a placeholder INT file

generated for you to place code in. However if you have a process sensitive

to latency, conflict, then more study is required of PSOC interrupt handling so

that you can optimize critical response threads, etc..

 

So no, we do not get off the hook with the ISR symbol, but it does, for most

ISR implemenation, make life a lot easier.

 

Regards, Dana.



Re: a simple tutorial on interrupts

Bob Marlowe posted on 02 Mar 2013 12:20 PM PST
Top Contributor
1768 Forum Posts

When I read the title of your thread correctly, you were asking for something "simple". The ISR-component IS something simple or even making something complex as simple as possible. Have a look at the APIs the ISR-component provides you with.

 

And: Yes, I have spent hours to understand the interrupt controllers I had to deal with, but it took me 5 minutes to get an interrupt on a PSoC5 to work included routing, compile and programming the target. Probably some hours wasted.

 

Bob



Re: a simple tutorial on interrupts

mahmoud posted on 03 Mar 2013 11:43 PM PST
Top Contributor
67 Forum Posts

 got it... thanks :D



Re: a simple tutorial on interrupts

Bob Marlowe posted on 03 Mar 2013 02:21 AM PST
Top Contributor
1768 Forum Posts

You are always welcome!

By the way: I teach the principles of interrupts with the following example:

 

Assume, you are making a cake and follow the recipe which, in the world of computers, is nothing else as an algorithm: Thake this, do that... and so on.

Suddenly in the middle of this process the door-bell rings (That's the interrupt!) and UPS is there delivering a parcel for you. You drop everything (no, not on the floor!), get the parcel, lay it aside and sign the aquittance (right word for that?). After closing the door you continue with your cake. When now you beat your pastry with an UPS-pencil instead of a whisk something has gone wrong inside your interrupt handling.

 

Bob



Re: a simple tutorial on interrupts

danaaknight posted on 03 Mar 2013 03:21 AM PST
Top Contributor
1773 Forum Posts

One last point, as simple as the use of the ISR module is, it will let you do

what you should not.......

 

Example, you have a 10 Mhz signal on a pin, and think you will generate

an interrupt on + edge.  The ISR module does not have a clue you just

consumed most of the MIPs in the machine servicng, or trying to service an ISR

with way too high a rate. But the module will let you do this.

 

Candy is not the solution to all sweet cravings.

 

So in closing, the ISR module is a simple way of implementing the majority

of interrupt needs, but you cannot avoid totally critical considerations for

more demanding situations.

 

Regards, Dana.

 

 



Re: a simple tutorial on interrupts

mahmoud posted on 03 Mar 2013 09:03 AM PST
Top Contributor
67 Forum Posts

 seriously thanks for all the great info :) . u are the best.






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