UART on CYW943907AEVAL1F
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
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.
- Slow UART
- 16650 compatible 2-wire
- RX and TX buffers are both of 1 byte
- Can support 115.2 Kbps baud rate
- Fast UART
- 4 wire (TX/RX/CTS/RTS) UART
- Can support 3 Mbps baud rate
- RX and TX buffers are both of 64 bytes
- Supports interrupts and HW handshaking
- GCI UART
- 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
- wiced_uart_init(wiced_uart_t uart, const wiced_uart_config_t* config, wiced_ring_buffer_t* optional_rx_buffer )
- uart: The interface which should be initialized, platform header file enumerates interfaces from WICED_UART_0 to WICED_UART_MAX.
- config: UART configuration structure, defined in WICED/platform/include/platform_peripheral.h
- optional_rx_buffer: Pointer to an optional RX ring buffer
- return: WICED_SUCCESS or WICED_ERROR
- wiced_uart_transmit_bytes( wiced_uart_t uart, const void* data, uint32_t size )
- data: Pointer to the start of data
- size: Number of bytes to transmit
- wiced_uart_receive_bytes( wiced_uart_t uart, void* data, uint32_t* size, uint32_t timeout )
- data: Pointer to the buffer which will store incoming data
- size: Specifies number of bytes to receive; returns number bytes received and placed in the data buffer
- timeout: Timeout in milliseconds. WICED_WAIT_FOREVER and WICED_NO_WAIT can be specified for infinite and no wait.
- 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.
- Tags:
- cyw943907aeval1f
- uart