j_girl Guest
|
PIC18F4550 USB PC Host Read Requests not working properly |
Posted: Wed Apr 26, 2006 4:20 pm |
|
|
Hi,
I work for a small company that is designing a USB Bulk Device to communicate with a custom PC program built with National Instruments Labview 7.1. I am using a PIC18F4550 as the USB controller. Our company bought the USB kit from CCS and have included the header files given with the product for the Bulk Demo program (pic_usb.h,usb_demo_scope,usb.c). Including those files in my code, I used the user functions (usb_get_packet and usb_put_packet, etc..) to communicate with Labview. Everything works well, the device enumerated, and the two can successfully communicate. We do however have a problem when the Labview program attempts to read more than once when there is no data to send.
This is what happens:
1. PC requests data
2. PIC sends data
3. PC requests data (Now the PIC has not written any new data)
4. PC displays timeout error
5. PC requests data
6. PC receives data from step 2 above
7. PC requests data (PIC still hasn't written)
8. PC displays timeout error
9. PC requests data
10. PC receives data from step 2
11. Continues alternating
I think this may be a data0/data1 toggle issue, but I am not sure. Is the PIC (through the supplied header files) taking care of sending a NAK when there is no new data? Do I need to take care of this data0/data1 bit manually. Also, how can I (without a USB analyzer) set up some kind of test sequence with CCS's debugger to check what exactly is happening?
Any help would be greatly appreciated!!!
Thanks ![Confused](images/smiles/icon_confused.gif) |
|