Well MP lab says I have something that's compile-able.
I dont like asking for code assistance, however can you give me a sanity check here?
To setup the timer: (This goes into your initialisePic() function)
Code:
INTCON2bits.TMR0IP = 0 ; // Set timer0 interrupt to low priority
INTCONbits.TMR0IF =0;// Clear the timer0 interrupt flag
//TMR0L = 106; // Reset the timer0 counter
T0CON = 0b11000110; // Timer0 on, 8-bit and 1:16 prescaler
INTCONbits.TMR0IE = 1;
// Enable interrupts
INTCONbits.GIEL = 1;
//Dont Enable the high one, because its used for USB interrupt stuff, and we are polling.
Then for the lowPriorityISRCode() function:
Code:
void lowPriorityISRCode()
{
PORTB =0x00;
// // Application specific low-priority ISR code goes here
if(!HIDRxHandleBusy(USBOutHandle))
{
sprintf(debugString, "This is a Timer.");
debugOut(debugString);
USBOutHandle = HIDRxPacket(HID_EP,(BYTE*)&ReceivedDataBuffer,64);
}
INTCONbits.TMR0IF = 0;
}
This should work right? I enabled the timer, enabled the interrupt, gave a priority. However the Timer has never been triggered...