- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I also uncommented M8C_EnableGInt ;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One further note, GPIO isr's are aggragated, you need to use a
mask to figure out what pin did it.
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This application note (AN2094 - PSoC 1 - Getting started with GPIO) will also help in your application.
http://www.cypress.com/?rID=2900
-Rajiv Badiger