cartic
Joined: 16 Nov 2004 Posts: 8
|
GPIO interrupt |
Posted: Thu Jun 16, 2005 12:03 pm |
|
|
Hello everyone,
I am using PIC 12F675.I need the PIC to wake up from sleep by a GPIO interrupt on GP0.
I used the directive #INT_RA0.
I saw its defined in the 12f675.h header file.
But I get an error, when I compile saying "INVALID PREPROCESSOR DIRECTIVE".
I would like to know, what is wrong in the code
Code: |
#INT_RA0
interrupt_handle()
{
static int data;
if(data==0x30){
data=0x31;
}
else {
data=0x30;
}
}
// MAIN PROGRAM
void main()
{
init();
enable_interrupts(GLOBAL);
enable_interrupts(INT_RA0);
while(1)
{
SLEEP();
delay_ms(100);
}
}
|
Aslo, I saw an INT_RB directive in the 12f675.h header file.
Since, there is only one GPIO port, I dont know, what is the purpose of INT_RB.
And also, I would like to know, how the interrupts are defined in the header file, I tried to figure it out but I could'nt . It be really helpful, if somebody can help me on this issue.
Thanks
cartic |
|