View previous topic :: View next topic |
Author |
Message |
Jean FOUGERON
Joined: 30 Nov 2012 Posts: 110 Location: France
|
Still USB <-> Host (VB6) issue |
Posted: Tue Apr 09, 2013 2:57 am |
|
|
Hi friends
Does anybody know something on this subject?
I wrote my PIC application as follows:
Code: |
if(usb_enumerated())
{
if(usb_kbhit(1))
{
usb_get_packet(1,in_data,USB_CONFIG_HID_RX_SIZE);
Traitement();
usb_put_packet(1,in_data,USB_CONFIG_HID_TX_SIZE,USB_DTS_DATA1);
}
} |
And tried 2 methods to exchange data with it in VB6.
Both connect themselves = OK
First is based upon usbhidio: (http://www.lvr.com/hidpage.htm#MyExampleCode) and it often takes Timeout seconds to answer (PIC receives data and send them back, but WaitForSingleObject function in VB takes a long time = 6s to read them).
Second one is based on mcHID.dll from http://www.mecanique.co.uk/ and seems easier to program, apart the fact that no data are sent from the Host by using the function hidWriteEx(VendorID, ProductID, OutputReportData(0)) (the PIC doesn't receive any data).
Have you an idea ? |
|
|
Jean FOUGERON
Joined: 30 Nov 2012 Posts: 110 Location: France
|
|
Posted: Thu Apr 11, 2013 3:34 am |
|
|
I succeeded to send data from the host, I'd to add a 0x00 on first byte !!!
Youpii !
But the delay is not solved |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Thu Apr 11, 2013 5:13 am |
|
|
general comments...
What happens if you use a 'terminal program' like RealTerm? Is there any delay ?
I don't use VB, but have heard it's very 'top heavy'. Instead I've used Delphi and haven't seen any delays, especially 6 seconds...wow!
There is a lot of 'overhead' with using USB, perhaps other applications and programs are slowing down the PC ?
hth
jay |
|
|
|