Kryten
New Member
Hi
Im having dificulties compiling this code. It halts on the red section...
I thought I had it right
This is part of Dwengo turtorial for light tracking servo
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()
{
}