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

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
LuTa_4642501
Level 3
Level 3
Welcome!

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.

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

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

https://www.cypress.com/file/140296/download

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,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
1 Reply
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

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

https://www.cypress.com/file/140296/download

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,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes