2 Replies Latest reply on Jul 31, 2013 5:42 AM by albert.yakupov

    GPIF master, U to P

    albert.yakupov

      Dear Sirs,

         

      I want to send packet of 1024 bytes to usb-out endpoint, and then transfer 1024 bytes from buffer in group of 4 bytes to P-port.

         

      Can I do this using DMA AutoChannel?

        • 1. Re: GPIF master, U to P
          gaya

           Hi,

             

           

             

          What do you mean by group of four bytes? Is any signalling (handshake) required before start/ after end of evry 4 bytes? Please detail the applciation a little bit.

             

           

             

          Regards,

             

          Gayathri

          • 2. Re: GPIF master, U to P
            albert.yakupov

            Hi Gayathri,

            I mean that GPIF interface has data bus of 4 bytes. There is no signaling required before start / after end every 4 bytes.
            My application has write/read a data from a host computer to/from an external SRAM asynchronous memory via FX3 device.

            I has my board connected to FX3 device. The board contains two sync 32-bit registers, where FX3 writes address and data to be written in the async memory. Address and data registers are switched and written using GPIO.

            When I want write data to external memory, I send array of bytes to USB-out endpoint from host comuter.
            Therefore I create CY_U3P_UIB_SOCKET_PROD_1 to CY_U3P_PIB_SOCKET_1 auto mode dma channel.
            Array of bytes has format as follow:

            Number of word | Byte (hex)
            0                            | 00 00 00 04          //some address
            1                            | 01 01 01 00          //some data
            2                            | 00 00 00 05          //some address
            3                            | 02 02 02 02          //some data
            ....
            1022                     | 01 00 00 10          //some address
            1023                     | 0F 00 10 3F          //some data

            First word (4 bytes) points an address where a second word (4 bytes) of data will be written (foreach 8 bytes of array).
            The array may have variable size. State machine writes address word in address register, and data word to data register, and then assertes WE signal of async memory.

            When I want read data from external memory, I send another array of bytes to USB-out endpoint using same auto mode dma channel.
            Array of bytes has format as follow:

            Number of word | Byte (hex)
            0                            | 00 00 00 04           //some address
            1                            | 00 00 00 05           //some address
            ....
            256                       | 01 00 00 10           //some address

            Each word (4 bytes) of a transerred array points to an address, a data will be read from. A state machine reads each data word to buffer of socket_0. I create CY_U3P_PIB_SOCKET_0  to CY_U3P_UIB_SOCKET_CONS_1 auto mode dma channel to transfer the buffer of delivered data from exteranal memory to host computer.

            As FX3 executes 2 different operation: read and write, I create manual channel USB_PROD to CPU to switch between read_state_machine and write_state_machine before I send array of bytes  via CY_U3P_UIB_SOCKET_PROD_1 to CY_U3P_PIB_SOCKET_1 auto mode dma channel for read/write operation

               

            Questions:

               

            1) Will this concept work?

               

            2) Do you know simpler way to implement read/write operation to external async memory?

               

            3) How long state machines are switched?