occasional transmission errors with 16.5MHz RC oscillator

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Mon Mar 17, 2008 5:13 pm

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.

iphi
Rank 2
Rank 2
Posts: 68
Joined: Mon Jun 25, 2007 11:37 am

Post by iphi » Mon Mar 17, 2008 6:16 pm

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

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Mon Mar 17, 2008 6:31 pm

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.

Post Reply