This blog post provides an overview of the UART interfaces available in CYW43907, which has three UART ports and a sample application is provided to transmit data using any one of the three UART ports.

  1. Slow UART
    1. 16650 compatible 2-wire
    2. RX and TX buffers are both of 1 byte
    3. Can support 115.2 Kbps baud rate
  2. Fast UART
    1. 4 wire (TX/RX/CTS/RTS) UART
    2. Can support 3 Mbps baud rate
    3. RX and TX buffers are both of 64 bytes
    4. Supports interrupts and HW handshaking
  3. GCI UART
    1. Typically used for WLAN/BT coexistence.

The tables below display the pin assignment of CYW943907AEVAL1F kit for the above mentioned three UART ports.

 

WICED_UART_1 (Slow UART)
MURATA Module Pin NameWICED Header
UART1_TXDRF_SW_CTRL_7_UART1_TXDJ6.37
UART1_RXDRF_SW_CTRL_6_UART1_RXDJ6.36

 

WICED_UART_2 (Fast UART)MURATA Module Pin NameWICED HeaderArduino Header
UART0_RXDUART0_RXD_INJ6.18J10.1
UART0_TXDUART0_TXD_OUTJ6.20J10.2
UART0_CTSUART0_CTS_INJ6.22NA
UART0_RTSUART0_RTS_OUTJ6.24NA

 

WICED_UART_3 (GCI UART)MURATA Module Pin Name
WICED Header
UART2_TXDRF_SW_CTRL_9_UART2_TXDJ6.39
UART2_RXDRF_SW_CTRL_8_UART2_RXDJ6.38

 

If the user wants to use Fast or GCI UART on this platform, they can choose the clock frequency based on the allowable baud rate error which is provided in the following tables. If the user wants to save on the active power consumption, it is advisable to go for the CLOCK_ALP (can be modified in platform_uart.c).

 

Rate Error when src_clk = CLOCK_ALP

 

 

Nominal Baud RateTarget Baud RateActual Baud Rate
Rate Error
1152001152001154320.20%
10000009842009842101.58%
1500000150000015583333.89%
2000000200000020777773.89%
2500000249330024933330.27%
3000000300000031166663.89%

 

Rate Error when src_clk = CLOCK_HT

 

 

Nominal Baud RateTarget Baud RateActual Baud RateRate Error
1152001152001152730.06%
1000000100000010000000.00%
1500000150000015094330.63%
2000000200000020000000.00%
2500000250000025000000.00%
3000000296290029629621.24%

 

 

 

A sample application is provided in this blog to demonstrate the usage of the WICED UART APIs to send characters on the UART. By default, Slow UART will be used for data transmission; based on the user choice (USER_1 button press), fast UART, GCI UART, slow UART ports will be selected to transmit the same data.

 

The APIs available for configuring a UART is available in the location

43xxx_Wi-Fi/include/wiced_platform.h

  1. wiced_uart_init(wiced_uart_t uart, const wiced_uart_config_t* config, wiced_ring_buffer_t* optional_rx_buffer )
    1. uart: The interface which should be initialized, platform header file enumerates interfaces from WICED_UART_0 to WICED_UART_MAX.
    2. config: UART configuration structure, defined in WICED/platform/include/platform_peripheral.h
    3. optional_rx_buffer: Pointer to an optional RX ring buffer
    4. return: WICED_SUCCESS or WICED_ERROR
  2. wiced_uart_transmit_bytes( wiced_uart_t uart, const void* data, uint32_t size )
    1. data: Pointer to the start of data
    2. size: Number of bytes to transmit
  3. wiced_uart_receive_bytes( wiced_uart_t uart, void* data, uint32_t* size, uint32_t timeout )
    1. data: Pointer to the buffer which will store incoming data
    2. size: Specifies number of bytes to receive; returns number bytes received and placed in the data buffer
    3. timeout: Timeout in milliseconds. WICED_WAIT_FOREVER and WICED_NO_WAIT can be specified for infinite and no wait.
  4. The definitions of the above APIs are found in

43xxx_Wi-Fi/WICED/platform/MCU/BCM4390x/peripherals/uart/platform_uart.c

 

To access STDIO_UART using the generic UART APIs, it is necessary to add a global define WICED_DISABLE_STDIO in the uart.mk.