Interrupt handeling problem

Kryten

New Member
Hi

Im having dificulties compiling this code. It halts on the red section...

I thought I had it right
Code:
#pragma interrupt YourHighPriorityISRCode
void YourHighPriorityISRCode ()
{
	if(PIRbits.TMR1IF == TRUE)                  // check interrupt flag from timer0
	{
		if(PORTbits.RB5 == 0)
			{
			TMR1H = (timerServo & 0xFF00) >> 8; // Keep MSB
			TMR1L = timerServo & 0x00FF;        // Keep LSB
			PORTBbits.RB5 = 1;                   // high pulse
			}
		else
			{
			TMR1H = 0x8A                       // Timer interups after 83.3ns*8*(65536-35536) = +/- 20 ms
			[COLOR="Red"]PORTBbits.B5 = 0;[/COLOR]                  // low pulse
			}
		PIR1bits.TMR1IF = FALSE;               //reenable TMR1 interrupt
	}	
}

#pragma interruptlow YourLowPriorityISRCode
void YourLowPriorityISRCode()
{
}
This is part of Dwengo turtorial for light tracking servo
 
lol Thanks for seeing that, I got kinda blind trying to figure out what was wrong
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…