Two Interrupts on EZ-BLE PSOC (CYBLE-014008-00) Pins P0.1 and P0.4

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

cross mob
Anonymous
Not applicable

I would like to use the Pins P0.1 and P0.4 (pads 5 and 9) as interrupts both triggered via falling edge on a CYBLE-014008-00. I've used both pins individually to trigger interrupts without problem in my circuit, but am experiencing difficulty using them at the same time in a program. 

   

I was reading AN86439 section 6.8, but it looks like that example is only possible if the pins are contiguous on adjacent physical pins. I tried clicking off this setting in the configuration option, but it says that is not allowed for pins with interrupts. 

   

Is there a way to use those two pins to trigger an interrupt? I've also tried to place two separate pin components. If there are two pins and two interrupts, it won't let me assign the correct pins due to there already being an interrupt on the port. If both pin components are connected to the same interrupt it says there are multiple drivers on the signal. 

   

In retrospect, it would have been easier to use other pins, but that's no longer an option. I do not necessarily need to determine which of the two pins the interrupt occurs (although this would be a bonus).

   

I'd appreciate any input! Thanks

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

You may use two Isr components connected to the pins, not using the pin-internal interrupt. The priorities can be adjusted when necessary.

   

Do not use lengthy code as writing to UART etc, using delay functions or longer loops. Best practice is to clear the interrupt cause when needed (in my example it is not), set a global volatile variable that is checked in the main loop and acted upon.

   

 

   

Bob

View solution in original post

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

You may use two Isr components connected to the pins, not using the pin-internal interrupt. The priorities can be adjusted when necessary.

   

Do not use lengthy code as writing to UART etc, using delay functions or longer loops. Best practice is to clear the interrupt cause when needed (in my example it is not), set a global volatile variable that is checked in the main loop and acted upon.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks for the response, I appreciate it. With the ISR components tied directly to the pins, is it possible to trigger the interrupts on the falling edge instead of a rising edge? Using the pin-internal interrupts provides that as an option, but I do not see it as one with the ISR components. 

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

Use a NOT gate to invert the input for the isr component.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Great idea, thanks. I successfully got it to trigger using the not gate, but I'm attempting to use the interrupt to wake from hibernate (should have mentioned this initially). When I add back in the CySysPmHibernate, it no longer operates as before I switched from the pin internal interrupt. Are the not gates available in hibernate mode? And if so, is there a reason why this new way of doing the interrupt (as opposed to the internal pin interrupt) would interfere with the hibernate mode?  Sorry for so many questions, I've just always used internal pin interrupts. 

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Can the new way of interrupt (no longer using the internal pin interrupt) be used to wake the device from hibernate?

   

If not, would it be possible to use a low power comparator instead?

   

Edited- it looks like the low power comparator is not available for those pins. I am also having difficulty routing the pins together, which was my second thought. Is there any reason why they would not be able to be connected internally and just use one internal pin interrupt? Please see attached

   

 

   

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

In hibernate (nearly) none of the components are running except the PIC (Peripheral Interrupt Controller). On some devices you need dedicated pins to get out of hibernate. See AN86233.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks for the suggestion for the additional reading. I see that in hibernate mode, it is necessary to use the PIC to wake up using the pins.

   

This brings me back to my initial question of not being able to use the PIC for the two desired pins at the same time. 

   

Is there any reason why I couldn't have one of the internal pin interrupts set to wake up the device via the PIC, and just route the second pin to the first pin? 

   

Edit: I've tried connecting the pins internally, but only the one with the internal interrupt triggers the interrupt. Shouldn't routing the pins together mean that the other pin should as well?

0 Likes
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

See attached project:

   

Imagine when hibernating the CPU is stopped. When a port interrupt occurs, the statement following the hibernate call will be executed. You may read the two pins polarities to see which one fired.

   

The global signal reference will give you an interrupt when the CPU is running.

   

 

   

Bob

Anonymous
Not applicable

Thanks! This works perfectly and I hadn't considered using the global signal reference. I was able to check the polarity to see which pin caused the interrupt. The flexibility of the module is great, and I'm still getting the hang of it. 

   

I sincerely appreciate your help and patience with my questions. If we happen to cross paths in the future I owe you a drink and/or lunch. 

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

That's a kind offer! Too bad that I do not frequently visit the US. Where are you located?

   

 

   

Bob

0 Likes
Anonymous
Not applicable

In Connecticut, but I spend some time in New York each week. And you? I don't get the chance to travel internationally often, unfortunately. 

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

I've been to San José, Portland and Seattle. I live in Germany near Bremen where the ESA and Airbus are. Far, far away...

   

 

   

Bob

0 Likes