PIC32MZ USB Device - Connection Detection

Kisen

Member
Hi

I am currently working on a USB Device design. It uses a PIC32MZ EF.

So far i have the device enumerate and have implemented the Microsoft Capability Descriptors so that it will install drivers using WINUSB and identify as a named device.
Bulk transfers are also working, so on the whole all going well.

The part that i am trying to complete now is some sort of connection status when PC software connects to the device interface and communicates over EP1 Bulk.

I have read that a device should only ever reply to host commands. So i cant send a signal from my device to see if we are connected.
I also cant seem to find any register on the PIC to indicate that enumeration or connection was successful apart from the VBUS status showing the device is powered.

So i had an idea.. When the device enumerates and the PC software connects, It should send a packet straight away to the device to say its connected. But... How does the device know if the software has disconnected?

I cant seem to get my mindset straight on the best way to achieve this. Has anyone done anything similar, know a better method ?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…