How to perform external interrupt in PSoC1?

A catchall for PSoC Mixed-Signal Array (microcontroller) discussions not captured by the other forums.

Moderator: ericb

How to perform external interrupt in PSoC1?

Postby jhyap on Thu Dec 22, 2011 1:05 am

Hi all,

I am using CY8C27443-24PXI and is still fairly new to this PSoC programming.

I would like to perform an external interrupt in my PSoC.

I have a pulse generator. every 1 second, pulse generator will generate 1 pulse.

Now, I want to connect the pulse generator to my PSoC. Every 1 second, when the pulse raise, the interrupt flag in PSoC will raise and display at 7segment.

In short, the PSoC will count each of every pulse of the generator and displaying the count using 7segment. If it detecting 10 pulse, then it will count 10.

In the implementation, the PSoC will function as a pulse counter. (Note that the pulse is from an external device)

The main idea of doing this should be setting a threshold value to detect the pulse and perform interrupt when PSoC detect any value above the threshold.

I would like to have some idea on how to do the coding and the hardware configuration (which pin to connect the output of pulse generator?) and also how to do the module configuration inside the PSoC designer.

Your help and comment is appreciated.
jhyap
Newbie
Newbie
 
Posts: 6
Joined: Mon Oct 31, 2011 12:16 am

Re: How to perform external interrupt in PSoC1?

Postby bobmarlowe on Thu Dec 22, 2011 1:25 am

The question is: What hardware are you going to use, do you have a(ny) developement kit at hand? Which input-pin you use depends on that.
The rest is (sounds) rather easy, you may declare any GPIO-Pin as generating an interrupt (preferrably on rising edge).
But
If you're a Newbee, why start with an Interrupt? you can route the 1Hz-signal (via a schmitt-trigger, if you like) to a counter which contents you read and display.

Some days ago I wrote a post in the "Cypress Developer Community" in PSoC1 to the Newbees, have a look at it, it may save you from un-neccesary bad experiences.

Happy coding
Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: How to perform external interrupt in PSoC1?

Postby danadak on Thu Dec 22, 2011 3:37 am

Field Application Engineer
KB1RHB Mostly listen :)
Semi Retired
User avatar
danadak
The Big Cheese
The Big Cheese
 
Posts: 2008
Joined: Thu Dec 27, 2007 8:42 am
Location: New Hampshire

Re: How to perform external interrupt in PSoC1?

Postby jhyap on Thu Dec 22, 2011 8:11 pm

Hi bob,

I am using CY-PSoC1-001 training board which consist of CY8C27443 28-pin PSoC Device, a LCD display, a 4 digit 7segment display and 4 blinking LED.

The reason why I need to do external interrupt is because my ultimate objective is to display heart rate while inputting my ECG device to the PSoC. Thus, I need to practice with external interrupt. This mini project is evoked because of my personal interest.

I will check your post in "Cypress Developer Community" as well, thanks for your information.


Hi Dana,

Your recommended articles are always useful :)


Regards,
JH
jhyap
Newbie
Newbie
 
Posts: 6
Joined: Mon Oct 31, 2011 12:16 am

Re: How to perform external interrupt in PSoC1?

Postby bobmarlowe on Fri Dec 23, 2011 12:14 am

Hi jhyap,
hope your LEDs are not always blinking :wink: . When I had to use interrupts on a PSoC1 I was using C. There is a #pragma to declare an Interrupt routine.
You ought to avoid long delays while handling interrupts and you should avoid to call ANY C-function within it. The reason for the latter is, that the compiler tries to save only the
needed pseudo-registers (16) on the stack, but is not able to "see" which registers are used in another function, so pushes all of them. That costs time and stack-space!
In a file named "Interrupts.tpl" you'll have to insert a LJMP-instruction to your interrupt routine (Name preceeded by an underscore) but all that you'll find in Danadac's Doc-Hints.

Have a good (un-interrupted) x-mas
Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: How to perform external interrupt in PSoC1?

Postby danadak on Sat Dec 24, 2011 1:10 pm

The file to modify is boot.tpl in your root project directory.

Regards, Dana.
Field Application Engineer
KB1RHB Mostly listen :)
Semi Retired
User avatar
danadak
The Big Cheese
The Big Cheese
 
Posts: 2008
Joined: Thu Dec 27, 2007 8:42 am
Location: New Hampshire

Re: How to perform external interrupt in PSoC1?

Postby CypressRaj on Mon Nov 19, 2012 4:12 am

For information on how to modify boot.tpl or boot.asm file to execute custom ISRs, refer AN73617 - "PSoC®Designer Boot Process, From Reset to Main". It can accessed from following link-
http://www.cypress.com/?rID=58522

Look for "GPIO Interrupt Vector" in boot.tpl or boot.asm file.
CypressRaj
Cheese Cube
Cheese Cube
 
Posts: 37
Joined: Sun Nov 22, 2009 10:07 pm


Return to PSoC1 General

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron