1 Reply Latest reply on Jul 6, 2020 8:21 PM by JayakrishnaT_76

    How to Configure FX3 to have SPI , I2C, I2S , Uart and GPIOS?


      I'm using this configuration:


          /* Configure the IO matrix for the device. On the FX3 DVK board, the COM port

           * is connected to the IO(53:56). Either select 32-bit GPIF or use UART_ONLY mode. */

          CyU3PMemSet ((uint8_t *)&io_cfg, 0, sizeof(io_cfg));

          io_cfg.isDQ32Bit = CyFalse;

          io_cfg.s0Mode = CY_U3P_SPORT_INACTIVE;

          io_cfg.s1Mode = CY_U3P_SPORT_INACTIVE;

          io_cfg.useUart   = CyTrue;

          io_cfg.useI2C    = CyTrue;

          io_cfg.useI2S    = CyTrue;

          io_cfg.useSpi    = CyTrue;

          /* This mode is for SPI, UART and I2S. I2C is still enabled. */

          io_cfg.lppMode   = CY_U3P_IO_MATRIX_LPP_DEFAULT;

          /* No GPIOs are enabled. */

          io_cfg.gpioSimpleEn[0]  = 0;

          io_cfg.gpioSimpleEn[1]  = 0x402000; // 0x00002000; /* GPIO 45 */

          io_cfg.gpioComplexEn[0] = 0;

          io_cfg.gpioComplexEn[1] = 0;

          status = CyU3PDeviceConfigureIOMatrix (&io_cfg);


      But I lost UART connection. How to check where the uart bus is with this configuration?

      And what about the SPI and I2S did the move to other pins too?


      The datasheet doesn't have that information.

        • 1. Re: How to Configure FX3 to have SPI , I2C, I2S , Uart and GPIOS?



          Please refer to page 16 of FX3 datasheet to understand how the different pins are multiplexed. Link to the same is given below:



          In your configuration, the isDQ32 field is set to false which indicates that the data bus for GPIF II block is not 32 bits. Also, the lppMode is set to CY_U3P_IO_MATRIX_LPP_DEFAULT which indicates the default LPP mode where all the peripherals are enabled. The corresponding pins can be identified by checking the column 16-bit data bus + UART + SPI + I2S from the table provided in page 16 of FX3 datasheet.


          According to this, the UART block for your configuration will be available at GPIO[46:49]. If you are using CYUSB3KIT-003, then the UART block is to be made available at GPIO[53;56] to have a Virtual COM port connection established. This is because the hardware of the Explorer kit is made in such a way that the GPIO[53:56] is connected to a USB-Serial chip.


          Best Regards,