deepakomanna
Joined: 06 Mar 2007 Posts: 92 Location: Pune,India
|
PROBLEM WITH GPIO INTERRUPT i.e. port on change interrupt |
Posted: Fri Mar 09, 2007 12:05 am |
|
|
Dear sir,
here i am getting error while compling this code.i am sensing pulses at GPIO0,GPIO1 pin as an interrupt. if pulse come at GPIO0,O/P high,and if pulse at GPIO1,O/P LOW.
But i am getting error at #INT_RA0 & #INT_RA1 line.these interrupt are defined in 12f629.h file. still error.
for this i am using pic12f629,MPLAB V7.5 & CCS PCM C Compiler, Version 3.249, 34534.
Plz refer below source code,
Thanking You,
Regards,
Deepak.
*****************SOURCE CODE************
#include<12f629.h>
#fuses INTRC,NOWDT,PUT,NOMCLR,NOBROWNOUT,NOPROTECT
#use delay(clock = 4000000)
#define GPIO0 PIN_A0
#define GPIO1 PIN_A1
#BYTE OSCCAL = 0X90
#BYTE WPU = 0X95
#BYTE INTCON = 0X8B
//#BYTE IOC =0X96
void init_CPU();
void main()
{
init_CPU();
while(1)
{
}
}
void init_CPU()
{
WPU = 0B00001011;
//IOC = 0B00000011;
INTCON = 0B11001000;
SET_TRIS_A(0B00000011);
SETUP_COMPARATOR(NC_NC_NC_NC);
ENABLE_INTERRUPTS(INT_RA0);
ENABLE_INTERRUPTS(INT_RA1);
#asm
call 0x3ff
movlw OSCCAL
#endasm
}
*********/// ERROR IN THE FOLLOWING LINE ///**************
#INT_RA0
PORT0_ISR()
{
OUTPUT_HIGH(GPIO0);
CLEAR_INTERRUPT(INT_RA0);
}
#INT_RA1
PORT1_ISR()
{
OUTPUT_LOW(GPIO1);
CLEAR_INTERRUPT(INT_RA1);
}
*******/// END OF PROGRAME ///*************************** |
|