#pragma code HIGH_INTERRUPT_VECTOR = 0x08
void High_ISR (void)
{ // If you are using this programe hex file with a conventional
_asm goto YourHighPriorityISRCode _endasm //device programmer this directives will help
}
#pragma code LOW_INTERRUPT_VECTOR = 0x18
void Low_ISR (void)
{
_asm goto YourLowPriorityISRCode _endasm
}
//---------------------------------------------------------------End of re-direction-----------------
void main(void)
{
Delay10KTCYx(2);
ports_ini();
Timer0_ini();
Timer4_ini();
Timer5_ini() ;
Timer6_ini();
EnableInterrupts();// two times
lcd_ini();
PORTCbits.RC2=1;
Delay_Ms(100);
PORTCbits.RC2=0;
Delay_Ms(150);
PORTCbits.RC2=1;
Delay_Ms(100);
PORTCbits.RC2=0;
lcdstringptr(EmbCkit,1);
lcdstringptr(USBMicro,2);
lcdstringptr(CurCount,3);
lcdstringptr(Digitis,4);
while(1)
{
PORTC |=0b00000011;
PORTB |=0b00011111;
Delay1KTCYx(250);
PORTC &= 0b11111100;
PORTB &= 0b11100000;
Delay1KTCYx(250);
if(INTCONbits.TMR0IF)
{
INTCONbits.TMR0IF=0;
_asm nop _endasm
}
if(PIR5bits.TMR4IF)
{
PIR5bits.TMR4IF=0;
_asm nop _endasm
}
if(PIR5bits.TMR6IF)
{
PIR5bits.TMR6IF=0; //I am getting flag set here on all timers
_asm nop _endasm
}
if(PIR5bits.TMR5IF)
{
PIR5bits.TMR5IF=0;
_asm nop _endasm;
}
}