GPIO ISR is not executed

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

cross mob
lock attach
Attachments are accessible only for community members.
ThBa_282891
Level 3
Level 3
First like received First like given

I begin to desperate, hopefully you can help 🙂

   

 

   

1. Changed Pind to "Pull down" and "Change from read"

   

2. added "ljmp _foo" to PSoCGPIOINT.asm

   

3. added

   

 #pragma interrupt_handler foo

int counting=0;

void foo(void)
{
    counting++;
    return;
}

   

to main.c.

   

 

   

The pin is working but the value is now increased when the is a edge.

   

I also attached the whole project.

   

 

   

Thanks for support

0 Likes
6 Replies
ThBa_282891
Level 3
Level 3
First like received First like given

I also uncommented M8C_EnableGInt ;

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

Some useful ref material on setting up ISR on GPIO and other -

   

 

   

http://www.cypress.com/?id=4&rID=36720

   

      http://www.planetpsoc.com/component/content/article/43-writing-a-c-isr.html

   

      http://www.planetpsoc.com/psoc1-articles-digital/13-basics-of-psoc-gpio.html?start=7

   

 

   

 

   

Regards, Dana.

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

One further note, GPIO isr's are aggragated, you need to use a

   

mask to figure out what pin did it.

   

 

   

Regards, Dana.

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

You have three pins enabled for interrupt, one of them is change from read. Since you read the port within the loop, ANY change of the signal (both edges) will trigger an interrupt. Test that by stop reading from the port, you'll see.

   

 

   

Happy coding

   

Bob

0 Likes
ThBa_282891
Level 3
Level 3
First like received First like given

Thanks a lot for the links, I will read carefully trough it when I have the time.

   

A colleague from my university made it with

   

M8C_EnableIntMask(INT_MSK0, INT_MSK0_GPIO);

   

and maybe some other changes, I currently searchung for them 😛

   

Anyway, I want to understand how it works, so thank you once again.

   

To give you an idea what I want to do. I want to read the Ulsewidth vom an RC-Remote into the PSoC. The idea is to use just one counter for different signals as they are never come at the same time. Therefore i will check inside the isr which pin is high and at the falling edge it will safe the value in on of a few variales.

   

So this was the idea and the reason why I have more than 1 PINs as Interrupt 🙂

0 Likes
Anonymous
Not applicable

This application note (AN2094 - PSoC 1 - Getting started with GPIO) will also help in your application.

   

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

   

-Rajiv Badiger

0 Likes