USB_SOF_HOOK macro executed twice per SOF
Posted: Mon Jun 03, 2013 11:26 am
I'm trying to get the alternate oscialltor calibration routine using the timer working in my application, and was running into some weird issues. I found that the USB_SOF_HOOK was being executed twice per frame, a couple microseconds apart when there is no data, or separated further if there is data.
In these captures, I have the USB_SOF_HOOK macro set to toggle the state of the "DEBUG2" line. I'm using the hid-mouse application with a attiny85 running at 16.5MHz, calibrated using osccal.o
Has anyone seen this behavior? I'm trying to keep the USB_SOF_HOOK macro as short as possible, but now it seems I'll have to add some check to make sure the code is executed only once per frame.
In these captures, I have the USB_SOF_HOOK macro set to toggle the state of the "DEBUG2" line. I'm using the hid-mouse application with a attiny85 running at 16.5MHz, calibrated using osccal.o
Has anyone seen this behavior? I'm trying to keep the USB_SOF_HOOK macro as short as possible, but now it seems I'll have to add some check to make sure the code is executed only once per frame.