C18 interrupt help

Status
Not open for further replies.

rahulcet

New Member
Iam very much stuck with how to use C18 with Interrupts. I simply wrote a pgm to go to an ISR when the RBO pin goes high. I have the code here which I succesfully compiled.

#include<p18f458.h>
#pragma config WDT=OFF
#pragma config OSC=HSPLL
#pragma config LVP = OFF
#pragma config PWRT = OFF

void interrupt()
{
blah blah;
INTCON=0b11110000;//make GIE one and flag low for next int to be detected
}

void main()
{
TRISB=0x01;
INTCON=0b11010000;//initialize interrupts for RBO low to high transition
INTCON2bits.INTEDG0=1;//interrupt
while(1)
{
blah blah;
}
}

Please do help me. When i give the trigger using stimulus worksapce when using mplab sim the control(the arrow) is not going to the ISR. In other words the interrupt is being accepted (which I understood from the fact that the RBOIF flag was being set by the processor), but the ISR is not routed. iam in a real fix. I have spent hours with this little pbm. this is the first time iam working with 18 f ints.

please do help me
thanks in advance
 
Last edited:
Me too

I need help but in my case I just want money. I need it now, boys and girls. Not fast but right now!

Please consider sending three thousand euros for a start.
 
Last edited:
Jpug #1
has a working example of C18 interrupts. It is for the timer but it shows how it is done.
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…