- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hallo
I'm trying to get a falling edge pin interrupt working following this tutorial:
http://www.cypress.com/?docID=50769 (from page 9).
in an init function in my code is configure and enable interrupts:
/* falling edge interrupt*/
PRT0IC0 |= 0x10;
PRT0IC1 &= ~0x10;
/* Enable P0_4 interrupts */
PRT0IE |= 0x10;
/* Enable GPIO interrupts */
M8C_EnableIntMask(INT_MSK0, INT_MSK0_GPIO);
/* Enable Global interrupts */
M8C_EnableGInt;
And in the same file, the ISR is implemented:
void GPIO_ISR(void)
{
if((PRT0DR & 0x10) == 0)
{
setPeripheralIOPin(led_backlight_enable); // this function works
}
}
In the .h file of that file i added the proposed pragma:
#pragma interrupt_handler GPIO_ISR
And as proposed in the tutorial i added the ISR jump to the boot.tpl and PSoCGPIOINT.asm file (tried both).
PSoCGPIOINT:
[/ode]
PSoC_GPIO_ISR:
;@PSoC_UserCode_BODY@ (Do not change this line.)
;---------------------------------------------------
; Insert your custom code below this banner
;---------------------------------------------------
ljmp _GPIO_ISR
;---------------------------------------------------
; Insert your custom code above this banner
;---------------------------------------------------
;@PSoC_UserCode_END@ (Do not change this line.)
reti
boot.tpl:
org 1Ch ;GPIO Interrupt Vector
`@INTERRUPT_7`
ljmp _GPIO_ISR
reti
As far as i'm concerned i've done everything named in the tutorial. But obviously i failed at some point as it isn't working. When i make P0.4 low (high by default), the led backlight pin doesn't become high.
P0.4 is defined as high Z in the chip editor with falling edge interrupt selected.
Does anyone of you know why?
Hope you can help me,
Thanks in advance
timberleek.
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
apologies for the makeup of the post.
I assumed
tags would do the trick. unfortunately, i don't see any edit possibility. is this correct?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Take a look at this for GPIO ISR setup -
Insofar as the post issue, the forum software has many issues. Possibly
next time paste it as a word paste, maybe that will retain formatting.
If you do Read Modify Writes on GPIO don't forget to use shadow registers -
http://www.cypress.com/?rID=2900 AN2094 - PSoC® 1 - Getting Started with GPIO
https://www.youtube.com/watch?v=tei6q5M3C0g Shadow Registers
http://www.cypress.com/?rID=39497 Shadow Registers
Regards,. Dana.