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

cross mob

UART on CYW943907AEVAL1F

lock attach
Attachments are accessible only for community members.

UART on CYW943907AEVAL1F

RaktimR_11
Moderator
Moderator
Moderator
500 replies posted 250 replies posted 100 replies posted

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 Name WICED Header
UART1_TXD RF_SW_CTRL_7_UART1_TXD J6.37
UART1_RXD RF_SW_CTRL_6_UART1_RXD J6.36

 

WICED_UART_2 (Fast UART) MURATA Module Pin Name WICED Header Arduino Header
UART0_RXD UART0_RXD_IN J6.18 J10.1
UART0_TXD UART0_TXD_OUT J6.20 J10.2
UART0_CTS UART0_CTS_IN J6.22 NA
UART0_RTS UART0_RTS_OUT J6.24 NA

 

WICED_UART_3 (GCI UART) MURATA Module Pin Name
WICED Header
UART2_TXD RF_SW_CTRL_9_UART2_TXD J6.39
UART2_RXD RF_SW_CTRL_8_UART2_RXD J6.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 Rate Target Baud Rate Actual Baud Rate
Rate Error
115200 115200 115432 0.20%
1000000 984200 984210 1.58%
1500000 1500000 1558333 3.89%
2000000 2000000 2077777 3.89%
2500000 2493300 2493333 0.27%
3000000 3000000 3116666 3.89%

 

Rate Error when src_clk = CLOCK_HT

 

 

Nominal Baud Rate Target Baud Rate Actual Baud Rate Rate Error
115200 115200 115273 0.06%
1000000 1000000 1000000 0.00%
1500000 1500000 1509433 0.63%
2000000 2000000 2000000 0.00%
2500000 2500000 2500000 0.00%
3000000 2962900 2962962 1.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.

pastedImage_0.png

Attachments
0 Likes
1292 Views