Page 2 of 2

Posted: Mon Mar 17, 2008 5:13 pm
by christian
We calibrate on every USB reset anyway. But if the device starts without USB connection, it's good to have a guess value available from last time. Other functionality of the firmware may require accurate timing, too.

Posted: Mon Mar 17, 2008 6:16 pm
by iphi
We calibrate on every USB reset anyway.


It seems I don't fully understand how this works yet. How will a USB reset be initiated? Does this happen on first connection only? Can the host also initiate a USB reset?
Exactly on what condition and from where will calibrateOscillator be called?

Thanks for helping me understand.

Regards, Thomas

Posted: Mon Mar 17, 2008 6:31 pm
by christian
USB RESET is when D+ and D- are both 0 for more than a couple of bits. The host sends USB RESET after connecting or when it sees other reasons for a reset (e.g. timeout during enumeration).

AVR-USB detects a RESET in usbPoll(). If it sees a RESET, it runs the hook macro when the reset status begins and when it ends.