3 Replies Latest reply on Mar 5, 2019 3:13 AM by HemanthR_06

    CY7C67200 (EZ-OTG) HPI Keyboard Example


      I am trying to follow AN6010 in order to enumerate a keyboard via the HPI coprocessor interface on the CY7C67200 device.


      The example uses SIE1 (Port 0), while my setup is using SIE2 (Port 2?).


      I believe I have successfully completed Steps 1a and 1b while making modifications for the corresponding registers related to SIE2 vs. SIE1.


      These are the initialization steps so far:


      Step 1a:

      Write 0x0000 to SIE2msg Register (0x0148).

      Write 0xFFFF to Host 2 Status Register (0xC0B0).

      Write 0x12C0 to HUSB_pEOT Register (0x01B4).

      Write 0x3080 to Interrupt Routing Register (0x0142).

      Write 0x0030 to Host 2 Interrupt Enable Register (0xC0AC).


      Step 1b:

      Write 0x0073 to COMM_INT_NUM (0x01C2). (HUSB_SIE2_INIT_INT)

      Write 0xCE01 to HPI Mailbox (COMM_EXEC_INT).


      At this point, I detect the HPI_INT and read the HPI STATUS and HPI Mailbox and verify that the COMM_ACK has been received successfully.


      Prior to starting Step 2, I attach the keyboard to Port 2A.


      Step 2:

      Write 0x0074 to COMM_INT_NUM (0x01C2).

      Write 0x003C to COMM_R0 (0x01C4).

      Write 0x0002 to COMM_R1 (0x01C6).  (Not sure if 2 is the correct port number for Port 2A on the CY7C67200?)

      Write 0xCE01 to HPI Mailbox (COMM_EXEC_INT).


      At this point, I detect a HPI_INT and read a value of 0x1001 from the HPI_Status register (which I believe indicates a SOF/EOP2 and an incoming mailbox interrupt).

      I read the mailbox and see 0x0FED, and this clears the mailbox interrupt.


      However, I'm not sure how to deal with the SOF interrupt.  Does anyone know how to service this interrupt to clear the status bit?


      I've tried reading SIE2msg Register (0x0148), reading and writing R0-R13, and reading the Host 2 Status Register (0xC0B0), but none of these seem to clear the SOF interrupt.