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

cross mob

CYW20719 and CYW20735 Peripheral and HCI UARTs

CYW20719 and CYW20735 Peripheral and HCI UARTs

RanjithK_41
Employee
Employee
5 sign-ins First comment on KBA 10 questions asked

This device has two UART blocks: PUART and HCI UART (BT_UART).

1. PUART (Peripheral UART)


CYW20719’s and CYW20735's PUART can be used to interface with peripherals. CYW20719 and CYW20735 can map the peripheral UART to any LHL GPIOs. The PUART is clocked at 24 MHz. Both PUART RX and PUART TX have a 256 byte FIFO.

PUART has the following features:

  • 8-bit transfer up to 3 Mbps
  • 9-bit transfer including stop bit up to 2.5 Mbps
  • Configurable flow control
  • Interrupt functionality on receive operation

PUART Initialization


The
wiced_hal_puart_init() API in wiced_hal_puart.h is used to initialize the PUART block. The wiced_hal_puart_select_uart_pads() API can be used to select TX/RX and optional CTS/RTS pins for the PUART hardware to use.

pastedImage_26.png

Figure 1: Data Framing Format

 

PUART Baud rate


The default PUART baud rate is 115200. The wiced_hal_puart_set_baudrate() API is used to set the baud rate. Typical rates are 115200, 921600, 1500000, and 3000000 bps, although intermediate speeds are also available. For more details on the baud rate, see the datasheet.

 

PUART Transmit


The
wiced_hal_puart_enable_tx() and wiced_hal_puart_disable_tx() APIs enable or disable transmit capability of the PUART, respectively.

The wiced_hal_puart_print() API is used to send a string of characters via the TX line.

The wiced_hal_puart_write() API is used to send one byte via the TX line.

PUART Receive


The
wiced_hal_puart_enable_rx() API is used to enable receive capability.

The wiced_hal_puart_rx_fifo_not_empty() API is used to check if there are any data available in the RX FIFO.

PUART Flow control


The
wiced_hal_puart_flow_on() and wiced_hal_puart_flow_off() APIs enable or disable the flow control of PUART, respectively.

PUART for RX Interrupt Operation


The
wiced_hal_puart_set_watermark_level() API updates the watermark level with the specified value. The default hardware flow control watermark level is 4 which is set during PUART initialization. This value determines the number of bytes required in the RX FIFO before an interrupt is generated.

The wiced_hal_puart_register_interrupt() API is used to register the interrupt handler for the PUART RX.

The wiced_hal_puart_reset_puart_interrupt() API is used to clear and reenable the PUART RX interrupt.

2. HCI UART


This UART is used for HCI transport for the controller mode and is also used for programming the device. The HCI UART signals are fixed to specific I/O pads.

To understand the programming sequence over the HCI UART interface, see ${INSTALLDIR}libraries\bt_sdk-x.x\docs\BT-SDK\WICED-HCI-Control-Protocol.pdf.

Note: Since SPI 1 and HCI UART share the same FIFO buffer; they cannot be used together.

0 Likes
2782 Views
Comments
PaAn_2744191
Level 0
Level 0

Thank you for the post. Just one question.

I can't find wiced_hal_puart_select_uart_pads()API in neither in the wiced_hal_puart.h file nor in the SDK docs.

Maybe I'm missing something or I'm not updated with the leatest version of  tools (my WICED-SDK Version: Wiced_006.002.001.0002)?

Suggestion?

Thank you.

Paolo

RanjithK_41
Employee
Employee
5 sign-ins First comment on KBA 10 questions asked

Hi Paolo,

As the PUART supports SuperMUX functionality, you can use wiced_hal_gpio_select_function() from wiced_hal_gpio.h in the recent SDK releases.

For example,

wiced_hal_gpio_select_function(WICED_P00,WICED_UART_2_TXD);

wiced_hal_gpio_select_function(WICED_P01,WICED_UART_2_RXD);

You can route flow control pins such as RTS and CTS pins similarly. Hope this helps.

Thanks.

PaAn_2744191
Level 0
Level 0

Perfect!

Thank you for the clarification.

Paolo