Ports
June 19, 2013, 02:42:37 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: SMF - Just Installed!
 
   Home   Help Search Login Register  
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Pages: [1]
  Print  
Author Topic: bulk data transfer using WinUSB  (Read 1078 times)
lcpoon
Member
***
Posts: 40


« on: April 18, 2012, 01: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................................................
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1642


WWW
« Reply #1 on: April 18, 2012, 09:18:29 am »

If I recall correctly, the test application loops back data from a single transaction (max endpoint size).

Jan
Logged
lcpoon
Member
***
Posts: 40


« Reply #2 on: April 18, 2012, 09:24:24 am »

If I send 256 bytes of data, error occured.
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1642


WWW
« Reply #3 on: April 18, 2012, 09:47:03 am »

What is the maximum endpoint size in the endpoint descriptor?

Jan
Logged
lcpoon
Member
***
Posts: 40


« Reply #4 on: April 18, 2012, 09:50:12 am »

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
Logged
Jan Axelson
Administrator
Frequent Contributor
*****
Posts: 1642


WWW
« Reply #5 on: April 18, 2012, 10:12:26 am »

Then the test application will loop back up to 64 bytes in bulk transfers.

Jan
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!