6 Replies Latest reply on Nov 19, 2014 8:29 PM by yi.yi

    64 Byte Control Transfer using Encore II

    shopitham.ram

      My USB component control Endpoint size in Encore 2 is only 8 Bytes . In my application I need to transfer 64 Bytes . How to do it?

         

      The control Endpoint is  a bidirectional endpoint that uses the same buffer (USB_INTERFACE_0_FEATURE_RPT_DATA) to Send and receive the data . This buffer size is only 8 bytes . So if the user is sending any data over the control endpoint there is a possiblility that data may be overwritten . Below is the solution to over come this problem in EnCore 2.

         

      The USB component of allows the user to override the exisisting routines easily . The Feature report such as GET and SET Report Rountines can be easily over written by following the steps in the USB UM datasheet . Please refer the section "Creating vendor specific device request and overriding existing request "of the UM datatsheet

         

      Attached is a simple project in which I have over ridden the exisisting routine for the GET and SET REPORT . I have made the buffer size uptp 64 bytes and tested the project . Also unlike the  normal way where there is only one buffer for both IN and OUT in this project there are separate buffers for both GET and SET reports . The Files that has been modified are the USB_cls_hid.asm and USB.inc

         


      Regards,
      SRAM
       

        • 1. Re: 64 Byte Control Transfer using Encore II
          yi.yi

           Excuse me, I tried to download and run the above engineering, find it is not required to achieve the function of main, the data did not pass the endpoint 0 to PC transmission, as indicated in the attachment.

          • 2. Re: 64 Byte Control Transfer using Encore II
            yi.yi

             Hi,VAVC

               
                    
               
                    
               
                Our project is  use to CY7C63813, not 68013 series.   
               
                Excuse me 63813 support  send and receive data through  endpoint 0? How to do it?   
               
                    
               
                Best Regards.   
               
                XYB   
            • 3. Re: 64 Byte Control Transfer using Encore II
              shopitham.ram

               I see you are using Bus hound .

                 

              To send and receive the data over the control endpoint , you need to use the Set and Get report feature with data field . To do that 

                 

              -> select the 'Devices' tab in the bus hound 

                 

              -> Select the USB device to which you send an d receive the data . 

                 

              -> Select the Send command button

                 

              ->  You will get the Bus Commander - USB Input device window that allows you to send the Set report and get report command .

                 

              -> For Set Report the command is 21 09 00 03 00 00 08 00

                 

              -> For Get Report it is A1 01 00 03 00 00 08 00

                 

              -> Type in the above command and hit run to read and write data .

                 

               

                 

              Attached is a picture showing the same .

                 

              -sobi

              • 4. Re: 64 Byte Control Transfer using Encore II
                yi.yi

                 Hi,SRAM

                   
                    
                   
                   
                     I mean that send and receive data through M8C processor, with program code, rather than Bus Hound tools.   
                   
                        
                   
                    Our project is  use to CY7C63813, not 68013 series.   
                   
                    Excuse me 63813 support  send and receive data through  endpoint 0? How to do it?   
                   
                        
                   
                    Best Regards.   
                   
                    XYB   
                • 5. Re: 64 Byte Control Transfer using Encore II
                  yi.yi

                   Hi,SRAM

                     
                      
                     
                     
                       I mean that I would to send and receive data through M8C processor with program code, rather than Bus Hound tools.   
                     
                          
                     
                      Our project is  use to CY7C63813, not 68013 series.   
                     
                      Excuse me 63813 support  send and receive data through  endpoint 0? How to do it?   
                     
                          
                     
                            
                        For Get Report it is A1 01 00 03 00 00 08 00. For Set Report it is 21 09 00 03 00 00 08 00,     
                       
                        The two report can be modified?     
                       
                              
                       
                        But we sent by host computer command is     
                       
                        CTL 80 06 0d 03 09 04 66 00 ,     
                       
                        and return information such as equipment requirements     
                       
                        DI 2e 03 23 00 32 00 32 00 30 00 2e 00 30 00 20 00 33 00 2e 00 32 00 20 ...,     
                       
                         How can we  achieve the functional        By modifying the which files       ?     
                       
                              
                     
                     
                      Best Regards.   
                     
                      XYB   
                     
                          
                  • 6. Re: 64 Byte Control Transfer using Encore II
                    yi.yi

                     Thank you for your answer!

                       
                            
                       
                        We need to realize the data points of 0 data transceiver in the USB enumeration, by acquiring the descriptor.   
                       
                        USB device receives the get command in the EPO_ISR interrupt descriptors such as 8006030300000800 by CTL, by the user program write cache the data and then call send function in the main function by DI, rather than a direct reply get descriptor command in the EPO_ISR interrupt, how to achieve this goal?   
                       
                            
                       
                        The following is the send function,   
                       
                        How to correctly used to send the data in the main function?   
                       
                        
                         export APP_USB_CB_d2h_cls_ifc_01    
                        
                          APP_USB_CB_d2h_cls_ifc_01:    
                        
                          push a    
                        
                          mov      [USB_DataSource], 0x01      ; Setting the data source to RAM    
                        
                          mov     [USB_DataPtr+1], <_USB_GET_FEATURE_RPT_DATA ; Set pointer to the Data Sent to PC    
                        
                          mov     [USB_DataPtr], >_USB_GET_FEATURE_RPT_DATA    
                        
                          mov     [USB_TransferSize],0x00    
                        
                          mov     [USB_TransferSize+1],[_Data_Size]; Set the Size of the data to be transfered    
                        
                          mov      [_Send_Flag] , 0x01    
                        
                          pop a    
                        
                          LJMP USB_InitControlRead