PORTS Forum
Ports and Interfaces => USB => Topic started by: lcpoon on April 18, 2012, 02:33:47 am
-
Hi,
I programmed the microcontroller with the codes pic_usb_device_winusb_jan_axelson_10.zip.
Then I used WinUSB VB to send data to the uController.
(a) If I send data <= 64 bytes, the read back is the same.
(b) If I send data = 128 bytes, the read back got errors.
Send data: Save data as # 0................................................Save data as # 1................................................
1st Read data: Save data as # 1................................................
2nd Read data: Save data as # 1................................................
I thought I should receive these data?
1st Read data: Save data as # 0................................................
2nd Read data: Save data as # 1................................................
-
If I recall correctly, the test application loops back data from a single transaction (max endpoint size).
Jan
-
If I send 256 bytes of data, error occured.
-
What is the maximum endpoint size in the endpoint descriptor?
Jan
-
unsigned char winusb_bulk_in_buffer[WINUSB_BULK_IN_EP_SIZE];
unsigned char winusb_bulk_out_buffer[WINUSB_BULK_OUT_EP_SIZE];
where WINUSB_BULK_IN_EP_SIZE = WINUSB_BULK_OUT_EP_SIZE = 64
0x07, /*sizeof(USB_EP_DSC)*/
USB_DESCRIPTOR_ENDPOINT, //Endpoint Descriptor
_EP01_OUT, //EndpointAddress
_BULK, //Attributes
0x40, 0x00, //WINUSB_BULK_OUT_BYTES
0x00, //Interval (unused)
0x07, /*sizeof(USB_EP_DSC)*/
USB_DESCRIPTOR_ENDPOINT, //Endpoint Descriptor
_EP01_IN, //EndpointAddress
_BULK, //Attributes
0x40, 0x00, //WINUSB_BULK_IN_BYTES
0x00, //Interval (unused)
/* Endpoint Descriptor */
0x07, /*sizeof(USB_EP_DSC)*/
USB_DESCRIPTOR_ENDPOINT, //Endpoint Descriptor
_EP02_OUT, //EndpointAddress
_INT, //Attributes
0x08, 0x00, //WINUSB_INTERRUPT_OUT_BYTES
0x0A, //Interval
0x07, /*sizeof(USB_EP_DSC)*/
USB_DESCRIPTOR_ENDPOINT, //Endpoint Descriptor
_EP02_IN, //EndpointAddress
_INT, //Attributes
0x08, 0x00, //WINUSB_INTERRUPT_IN_BYTES
0x0A //Interval
-
Then the test application will loop back up to 64 bytes in bulk transfers.
Jan