How to determine source of GPIO interrupt

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

Moderator: ericb

How to determine source of GPIO interrupt

Postby Lowell_Skoog on Wed Dec 14, 2005 11:25 am

How can I tell which pin generated a GPIO interrupt? I've looked through the Tech Ref Manual and several threads in this forum, and it appears that there is no "latched" register that holds the identify of the interrupting pin. It looks like my GPIO ISR needs to poll the various port data registers and determine which pin(s) may have generated the interrupt by checking their current states. Since the data registers are not latched, there is a chance that the interrupting signal might go away (and be undetectable) before my ISR has a chance to see it.

Do I understand things correctly? Thanks.
Lowell_Skoog
Newbie
Newbie
 
Posts: 4
Joined: Wed Dec 14, 2005 11:04 am

Postby wrightpc on Wed Dec 14, 2005 1:21 pm

That's about the size of it.

If you need to capture a critical short-duration event you could feed the pin into a digital block (or analog column comparators) so you get an identifiable interrupt you can process quickly. All depends on what you are trying to achieve.

If you have a few pins you are checking, firstly stick them ALL on ONE port as this will make your interrupt code a lot faster and cleaner. Can all of them cause an interrupt in every mode of your device? Sometimes simple logic can make the interrupt source from one thing only.

Adding extra hardware to latch your interrupt may be a possibility if timing cannot be guaranteed. It is better to add 10c to your product for an RS latch than have a product that is glitchy and intermittent.

Someone else may have sneaky things I haven't found yet.

Paul. :)
User avatar
wrightpc
The Big Cheese
The Big Cheese
 
Posts: 736
Joined: Thu Jul 28, 2005 7:56 pm
Location: Christchurch, New Zealand

Another way to have more IO interrupts

Postby Mark on Mon Dec 19, 2005 2:47 pm

Lowell,
If you have extra Digital blocks left over, you can always
use a DigBuf or DigInv User Module to generate more IO interrupts.
That way you will have an interrupt per pin.

Mark Hastings
User avatar
Mark
Cheese Cube
Cheese Cube
 
Posts: 50
Joined: Fri Jan 09, 2004 10:39 pm
Location: Mukilteo, WA, USA

Postby miaopc on Wed Dec 06, 2006 7:25 pm

Push this topic again.
I meet the same problem now. No digital blocks left in my project. Anyone have any good idea for me? Thanks!
User avatar
miaopc
Bite-Size Cheese
Bite-Size Cheese
 
Posts: 24
Joined: Sun Jan 02, 2005 2:09 am


Return to PSoC1 General

Who is online

Users browsing this forum: Bing [Bot] and 0 guests