3 Replies Latest reply on Jul 3, 2019 10:51 PM by SampathS_11

    Create some USB HID under PSoC 1 CY8C24894

    chzhc_4111666

      Dear Mdm/Sir,

      I was intending to Configure CY8C24894 as some generic data transfer between PC & this chip.

      I try to configure USBFS as some HID device, with input/output report of 8 bytes each. The generated report descriptor is shown below.

       

      USBFS_1_HID_REPORT_1_DESCR_START:                ;

          DB     06H, 00H, FFH                         ; Usage Page

          DB     09H, 01H                              ; Usage

          DB     A1H, 01H                              ; Collection

          DB     19H, 01H                              ; Usage Minimum

          DB     29H, 08H                              ; Usage Maximum

          DB     15H, 00H                              ; Logical Minimum

          DB     25H, FFH                              ; Logical Maximum

          DB     75H, 08H                              ; Report Size

          DB     95H, 08H                              ; Report Count

          DB     91H, 02H                              ; Output

          DB     19H, 01H                              ; Usage Minimum

          DB     29H, 08H                              ; Usage Maximum

          DB     15H, 00H                              ; Logical Minimum

          DB     25H, FFH                              ; Logical Maximum

          DB     75H, 08H                              ; Report Size

          DB     95H, 08H                              ; Report Count

          DB     81H, 02H                              ; Input

          DB     C0H                                   ; End Collection

      USBFS_1_HID_REPORT_1_DESCR_END:                  ;

       

      The simple firmware code is below

      USBFS_1_Start(0, USB_5V_OPERATION);

      while (USBFS_1_bGetConfiguration()==0x0); // Wait until it is configured.

      USBFS_1_EnableOutEP(OUT_EP);

      USBFS_1_LoadInEP(IN_EP, in_data_buf, NUM_BYTES, USB_TOGGLE); // Load & Enable

      OFF_LED1;

      OFF_LED2;

      while (1)

      {

           ON_LED1;

           if(USBFS_1_bGetEPAckState(OUT_EP))

           {

                ON_LED2;

                USBFS_1_bReadOutEP(OUT_EP, out_data_buf, NUM_BYTES);

                USBFS_1_LoadInEP(IN_EP, in_data_buf, NUM_BYTES, USB_TOGGLE); // Load & Enable

                USBFS_1_EnableOutEP(OUT_EP);

      }

      }

       

      I only see LED1 is on, but LED2 is always off.

      I am using the CyUSB.dll to do the report data sending.curHidDev.SetOutput(curHidReport.ID);

      The returned value tells me the sending is correct.

      Can you please help me where I am wrong?

      Thanks & Regards,

      Chao