Config of IO-Matrix : UART, SPI, GPIF and GPIO

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

cross mob
Anonymous
Not applicable

The FX3 is new for me, and I find it difficult to information about how to configure the IO matrix.

   

If i set 1 bit in "io_cfg.gpioComplexEn[1]" or "io_cfg.gpioSimpleEn[1]", my application don't start.

   

 

   

My need : 

   

GPIF:

   

    GPIF IO[0..7]                 (8 bit GPIF data bus)

   

    PCLK (GPIO[16])         (Clock for GPIF)

   

    GPIO[28] & GPIO[29]  (Input for GPIF)

   

 

   

SPI:

   

    SPI_SCK (GPIO[53])

   

    SPI_SSN (GPIO[54])

   

    SPI_MISO (GPIO[55])

   

    SPI_MOSI (GPIO[56])

   

 

   

UART:

   

    UART_TX (GPIO[48])

   

    UART_RX (GPIO[49])

   

 

   

GPIO:

   

    GPIO[22]  (Output)

   

    GPIO[34]  (Output)

   

    GPIO[36]  (Output)

   

    GPIO[37]  (Input)

   

    GPIO[38]  (Input)

   

    GPIO[39]  (Input)

   

    GPIO[40]  (Output)

   

    GPIO[41]  (Output)

   

    GPIO[46]  (Output)

   

 

   

Poul-Erik.

0 Likes
5 Replies
RoKl_290166
Level 4
Level 4
Welcome!

Hi,

   

while configuring the IO-matrix you have to take care that the pins which are used by UART, SPI and GPIF can't be used as simple or complex GPIO anymore. In gpioComplexEn[1] and/or gpioSimple[1] you can enable the pins [32...63] for GPIO-usage BUT they must not be already occupied by UART, SPI or GPIF!

   

Best regards!

0 Likes
Anonymous
Not applicable

With this configuration where will my UART be connected ?

   

    io_cfg.isDQ32Bit = CyFalse;
    io_cfg.useUart   = CyTrue;
    io_cfg.useI2C    = CyTrue;
    io_cfg.useI2S    = CyFalse;
    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]  = 0;
    io_cfg.gpioComplexEn[0] = 0;
    io_cfg.gpioComplexEn[1] = 0; //!

    status = CyU3PDeviceConfigureIOMatrix (&io_cfg);
 

   

I can't get any debug out.

0 Likes
RoKl_290166
Level 4
Level 4
Welcome!

This you can easily find out with the pin-description in the CYUSB3014-manual!

   

UART will be at pins GPIO[46...49], SPI at GPIO[53...56], I2C at GPIO[58...59].

   

Regards!

0 Likes
Anonymous
Not applicable

Hi Paul-Erik,

   

 

   

you get the UART at the GPIO pins 46-49

   

 

   

refer to datasheet of the FX3 Document Number 52136 on page 33 "Pin Description". If GPIF II is configured to 32-bit data mode, then UART is configured to the GPIO pins 53-56.

   

Regards,

   

lumpi

0 Likes
Anonymous
Not applicable

Thank you for your input.

   

I found an error in my PCB, (RX and TX was swaped), and after than i works.

   

 

   

Poul-Erik.

0 Likes