Hi Jan, thanks for getting back to me. I am using your USB HID code on a PIC18F4550. and I am polling around this loop shown below
Now when it goes into the ReportReceive(); routine that calls USBInHandle = HIDTxPacket(HID_EP,(BYTE*)&hid_report_in[0],HID_INPUT_REPORT_BYTES); I provide data in the hid_report_in
- array. Well this read routine gets called all the time even if I have not requested a read transfer. I would like data to be read only when requested from my VB6 program. I hope that this is a clearer now
Best Regards
Dave
// Check bus status and service USB interrupts.
USBDeviceTasks(); // Interrupt or polling method. If using polling, must call
// this function periodically. This function will take care
// of processing and responding to SETUP transactions
// (such as during the enumeration process when you first
// plug in). USB hosts require that USB devices should accept
// and process SETUP packets in a timely fashion. Therefore,
// when using polling, this function should be called
// frequently (such as once about every 100 microseconds) at any
// time that a SETUP packet might reasonably be expected to
// be sent by the host to your device. In most cases, the
// USBDeviceTasks() function does not take very long to
// execute (~50 instruction cycles) before it returns.
#endif
// Application-specific tasks.
// Application related code may be added here, or in the ProcessIO() function.
ProcessIO();
}