GPIO interrupt not working

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 Hi

   

I am trying CyPress project given in the link

   

http://www.cypress.com/?rID=38267

   

but the project D_InterruptVectorProject is not working, it regarding making an interrupt using GPIO pin,otherwise if anybody have code for interrupt using GPIO pin. Kindly reply

   

 

   

Thanks in advance

0 Likes
1 Solution
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Bad post, the precautions -

   

 

   

IRQ
To configure a Pins component with an interrupt, you must use a digital input and configure the
Interrupt parameter on the Input subtab. When interrupts are used, the Pins component
displays with a bounding box, and the IRQ is displayed extending from the bottom of the
component. The typical use case is to connect an Interrupt component to this terminal. If the Pin
Interrupt is used to wake the part up from sleep or hibernate low-power mode, the Interrupt
component connected to the Pins irq terminal may not have InterruptType set to
"RISING_EDGE."

   

 

   

An Interrupt can be used in all configurations of the Pins component, as long as you include
digital input.

   


 Interrupt – This parameter selects whether the pin can generate an interrupt and, if selected,
the interrupt type. The pin interrupt may be generated with a rising edge, falling edge, and
both edges. If set to anything but None, the component must be configured to be contiguous
to ensure it is mapped into a single physical port. A single port is required because all pins in
a port logically OR their interrupts together and generate a single interrupt signal and symbol
terminal. The Interrupt parameter uses dedicated pin interrupt logic, which latches the pins
that generated interrupted events. After an interrupt occurs, the Pin_ClearInterrupt() function
must be called to clear the latched pin events to enable detection of future events. If more
than one pin in the Pins component can generate an interrupt, the Pin_ClearInterrupt() return
value can be decoded to determine which pins generated interrupt events.

   


While not the preferred method, any digital input hardware connection can also be connected to
an isr component, providing the ability to generate a pin interrupt on high or low logic level
versus on an edge event. Using the digital input connection for a level interrupt does not use the
dedicated pin interrupt logic configured with this parameter.

View solution in original post

0 Likes
6 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

There is a note on Top Page of schematic for Project D -

   

 

   

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

To implement an ISR based on a pin -

   

 

   

   

 

   

1) Place digital input pin on schematic

   

 

   

2) Config pin as input, pull up or down, your preference. Under input tab

   

of pin config select rising or falling edge, depending on what pullup/down

   

you selected. Look at notes in datasheet for pin for additional considerations

   

on interrupt configuration.

   

 

   

3) Place isr component on schematic, connect to IRQ connection on pin. Name

   

it or accept default name, isr_1

   

 

   

4) In code enable global ISR's and the pin isr

   

 

   

      CYGlobalIntEnable;

   

       isr_1_Start()

   

 

   

5) Compile/Build project

   

 

   

6) There will now be a placeholder file for isr in project, named isr_1.c,

   

in that there is a placeholder area to put your interrupt code.

   

 

   

7) Compile/Build project

   

 

   

 

   

Thats pretty much it.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

A couple of precautions -

   

 

   

   

 

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Bad post, the precautions -

   

 

   

IRQ
To configure a Pins component with an interrupt, you must use a digital input and configure the
Interrupt parameter on the Input subtab. When interrupts are used, the Pins component
displays with a bounding box, and the IRQ is displayed extending from the bottom of the
component. The typical use case is to connect an Interrupt component to this terminal. If the Pin
Interrupt is used to wake the part up from sleep or hibernate low-power mode, the Interrupt
component connected to the Pins irq terminal may not have InterruptType set to
"RISING_EDGE."

   

 

   

An Interrupt can be used in all configurations of the Pins component, as long as you include
digital input.

   


 Interrupt – This parameter selects whether the pin can generate an interrupt and, if selected,
the interrupt type. The pin interrupt may be generated with a rising edge, falling edge, and
both edges. If set to anything but None, the component must be configured to be contiguous
to ensure it is mapped into a single physical port. A single port is required because all pins in
a port logically OR their interrupts together and generate a single interrupt signal and symbol
terminal. The Interrupt parameter uses dedicated pin interrupt logic, which latches the pins
that generated interrupted events. After an interrupt occurs, the Pin_ClearInterrupt() function
must be called to clear the latched pin events to enable detection of future events. If more
than one pin in the Pins component can generate an interrupt, the Pin_ClearInterrupt() return
value can be decoded to determine which pins generated interrupt events.

   


While not the preferred method, any digital input hardware connection can also be connected to
an isr component, providing the ability to generate a pin interrupt on high or low logic level
versus on an edge event. Using the digital input connection for a level interrupt does not use the
dedicated pin interrupt logic configured with this parameter.

0 Likes
Anonymous
Not applicable

Hi Dana, Thank you for the post. Very helpful. You said "If the Pin Interrupt is used to wake the part up from sleep or hibernate low-power mode, the Interrupt component connected to the Pins irq terminal may not have InterruptType set to "RISING_EDGE.""

   

The pin component data sheet, cy_pins_v2_10.pdf said that only applies to PSoC 5LP. I'm using PSoC 4 so I assume that does not apply. Correct? Or does that also apply to PSoC 4? And if so, how about Deep Sleep mode? Can a rising edge interrupt be used to exit from Deep Sleep mode? 

   

Thanks!

   

Mark

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Mark, you are here in a PSoC3 forum replying to a three year old post from Dana, who is not active for more than a year now.

   

I would suggest you to ask your question in a PSoC4 forum, because power saving modes are quire different in PSoC4 world.

   

 

   

Bob

0 Likes