pic18f2550
here in this code i have problem using USB with other timer interrupt
i need to test code with USB
i have internal interrupt with timer 1 every one one second toggle led
and external interrupt T0CK
just small problem every thing working fine but "" usb_interrupt_proc(); ""
make external interrupt fast
and timer not correct
code working without usb or usb disable -- disconnect usb -- timer will be correct
who to make two interrupt separate
my code timer include usb other thing mikroc give error
________________________________________________________________________________________________
void interrupt()
{
usb_interrupt_proc();
if (TMR1IF_bit){
TMR1IF_bit = 0;
onescound++;
if(onesnd==4){onesnd=0; LATB.F5=~LATB.F5 }
TMR1H = 0x0B; // 250 ms
TMR1L = 0xDC;
}
if (TMR0IF_bit){
TMR0IF_BIT=0;
counter++;
TMR0L=255;
}
}
here in this code i have problem using USB with other timer interrupt
i need to test code with USB
i have internal interrupt with timer 1 every one one second toggle led
and external interrupt T0CK
just small problem every thing working fine but "" usb_interrupt_proc(); ""
make external interrupt fast
and timer not correct
code working without usb or usb disable -- disconnect usb -- timer will be correct
who to make two interrupt separate
my code timer include usb other thing mikroc give error
________________________________________________________________________________________________
void interrupt()
{
usb_interrupt_proc();
if (TMR1IF_bit){
TMR1IF_bit = 0;
onescound++;
if(onesnd==4){onesnd=0; LATB.F5=~LATB.F5 }
TMR1H = 0x0B; // 250 ms
TMR1L = 0xDC;
}
if (TMR0IF_bit){
TMR0IF_BIT=0;
counter++;
TMR0L=255;
}
}
Last edited by a moderator: