Hi,
I have a simple questen (and I hope that the answare is simple too ).
Anybody knows if there is a way to detect if the USB cable ist connectet, and the enumeration is done successfully, by firmware? I don't have more pins available on my ATmega32 to detect the USB cable, so I'm trying to do it by software.
By the way, I'm working with the firmware of PowerSwitch.2007-03-29. Should I do a update to the newer version? My device is working fine, but I read something about problems wich appear sporadically (USB connection fails after some hours inactive), with the older version.
Regards,
Mario
USB cable detect
You can check for SOF frames which come in 1 ms intervals if the device is connected to a host. The easiest way to do this is to (1) wire INT0 to D- instead of D+, (2) update to the latest driver version and (3) define USB_COUNT_SOF in usbconfig.h.
Then you can check whether the global variable usbSofCount increments every millisecond.
Then you can check whether the global variable usbSofCount increments every millisecond.
Hi Christian,
thank you for your answare. Just one more question, where I should connect D+, if I connect D- to the INT0? I read in the usbconfig.h that D+ must be connected to INT0.
I'm already using the new driver version. The update was very easy, and the USB-communication still working great.
Regards,
Mario
thank you for your answare. Just one more question, where I should connect D+, if I connect D- to the INT0? I read in the usbconfig.h that D+ must be connected to INT0.
I'm already using the new driver version. The update was very easy, and the USB-communication still working great.
Regards,
Mario