Hi Chris,
just to confirm that doing the 100us USB Service works from within a timer allowing other operations to continue rather than just looping the USBService. Here is the code from within my service routine (using Darrell Taylor's instant interrupts - damn they're good!):
Code:
'*******************************************************************************
'Timer 0 Interrupt Handler: Service the USB
'*******************************************************************************
ServiceUSB:
if usbsetupcount < 15000 then ' If USBSetupCount has not finished then
usbservice ' Service the USB every 100us
usbsetupcount = usbsetupcount + 1
TMR0H = $FF ' Make Timer 0 hold 65387 so that it takes 100us
TMR0L = $6B ' to interrupt each time (Prescale of 8)
@ INT_RETURN
endif
usbservice ' Keep USB connection alive
TMR0H = $C5 ' Make Timer 0 hold 50537 so that it takes 10ms
TMR0L = $69 ' to interrupt each time (Prescale of 8)
@ INT_RETURN
Thanks very much for the fix - it is massively appreciated (although I should have thanked you months ago!). Hopefully this information will help others!
Rob
Bookmarks