Reading from UART and publishing through RFCOMM

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

cross mob
Roger
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hi,

I want to create a replacement for HC-06 using PSOC-6 (right now I'm working with the CYW920819EVB-02 development board). I could compile and test the RFCOMM examples given in Modus Toolbox, I could run it publishing data when an interruption occurs and when a timeout happens. But the main problem is that code is more than 700 lines just for an example and it is using already two UARTS through WICED SDK, so it's quite difficult to understand how a third UART (or reusing one of those two already used) could be added to the project to receive data from it. The example given for an external UART (but not sending data through bluetooth) is using PUART, which is already used in RFCOMM. So I'm quite lost how to add a new peripheral, in this case, a UART, into the project, someone can illuminate me?

Thanks in advance.

0 Likes
1 Solution
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi RoAl_1242481 ,

I think you can use PUART itself for your application requirement.

If you don't want to use PUART for debug logs, you can call wiced_set_debug_uart(WICED_ROUTE_DEBUG_NONE);

For PUART Tx , Rx APIs , refer header file wiced_hal_puart.h 

You can also refer example puart under HAL-20819EVB02 in Modus Tool Box.

Note: If you are new to MTB & 20xx devices, I would suggest you to go through WICED ACADEMY lab manuals as a getting started : GitHub - cypresssemiconductorco/CypressAcademy_WBT101_Files: Files for WICED Bluetooth 101 class

Regards,

Anjana

View solution in original post

3 Replies
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

HI RoAl_1242481 ,

I am not sure if I understood your query properly.

If you are looking for a third UART interface to connect a HW peripheral, then I am sorry its not possible with 20819.

There is only two HW UART interface possible - one is peripheral UART (PUART) and other one is HCI UART (which is used for programming the device. And later in the application can be used to send/receive raw packets as in MTB demo example under "HAL-20819EVB02- uart_raw_mode:).

Can you please confirm if the PUART is already connected with any other device? or please clarify your design requirement. Or please clarify the need of third PUART.

Thanks & Regards,

Anjana

0 Likes

Hi,

In my case, I would like to use PUART or HCI UART as a COM port when connected to a computer. So, right now is nothing connected there. But the example code RFCOMM uses both UARTs (one per programming and the other one for debugging, and here I don't understand quite well the structure of the example, why are both UARTs used?). Hence, I'm quite lost trying to understand how to use the example and use it as I want (why WICED_BT_TRACE encapsulates a UART?)

Thanks.

0 Likes
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi RoAl_1242481 ,

I think you can use PUART itself for your application requirement.

If you don't want to use PUART for debug logs, you can call wiced_set_debug_uart(WICED_ROUTE_DEBUG_NONE);

For PUART Tx , Rx APIs , refer header file wiced_hal_puart.h 

You can also refer example puart under HAL-20819EVB02 in Modus Tool Box.

Note: If you are new to MTB & 20xx devices, I would suggest you to go through WICED ACADEMY lab manuals as a getting started : GitHub - cypresssemiconductorco/CypressAcademy_WBT101_Files: Files for WICED Bluetooth 101 class

Regards,

Anjana