how to configure two uarts on the psoc 6 wifi-bt kit ?

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

cross mob
mara_3933621
Level 2
Level 2

We are working with psoc 6 and zigbee to receive data. We want to configure two uarts i.e. one for the zigbee (xbee pro s2b) and other for displaying data on tera term. We are unable to print the received data on tera term using psoc 6. We have tried writing programs on both softwares i.e. PSOC CREATOR and WICED yet there is no data on tera term. Please provide the necessary code and hardware changes if required.

0 Likes
1 Solution
5 Replies
Yeshwanth_KT
Employee
Employee
50 replies posted 25 replies posted 10 likes received

Hello,

For printing Debug data on any terminal emulator, you have to use SCB5 only. Please refer to the following code example to understand reading and writing from terminal,

https://www.cypress.com/documentation/code-examples/ce219656-psoc-6-mcu-uart-using-low-level-apis

To communicate with the Zigbee device use any block other than SCB5. Reading and writing data should be fairly straight forward as the above example.

Regards,

Yeshwanth

0 Likes

ok. But i also need to use wifi features for which i guess i have to use WICED software only and not CREATOR. What should i do?

My psoc 6 is CY8CKIT-062 Wifi Bt pioneer kit

0 Likes

If you are using WICED, configure the UART block as shown below,

    wiced_ring_buffer_t buffer;

    uint8_t data[5];

    ring_buffer_init(&buffer, data, 5);

    static const wiced_uart_config_t uart_config =

    {

        .baud_rate    = 9600,

        .data_width   = DATA_WIDTH_8BIT,

        .parity       = NO_PARITY,

        .stop_bits    = STOP_BITS_1,

        .flow_control = FLOW_CONTROL_DISABLED,

    };

    wiced_uart_init(WICED_UART_6, &uart_config, &buffer);

WICED_UART_6 is SCB5 in this case, check for your device in platform.c/.h

Configure one more SCB in the same fashion to communicate with Zigbee module.

Regards,

Yeshwanth

0 Likes

hello,

I have tried the same procedure as you mentioned, i'll attach my code , if you can please have a look and let me know where am i going wrong because i still cannot see any output on serial monitor

#include "wiced.h"

void application_start()

{

   uint8_t expected_data_size=20;

    wiced_init();

  #define RX_BUFFER_SIZE (2000)

   wiced_ring_buffer_t rx_buffer;

    uint8_t rx_data[RX_BUFFER_SIZE];

    ring_buffer_init(&rx_buffer, rx_data, RX_BUFFER_SIZE);

    wiced_uart_config_t uart_config =

    {

            .baud_rate =9600,

            .parity = NO_PARITY,

            .data_width= DATA_WIDTH_8BIT,

            .stop_bits= STOP_BITS_1,

            .flow_control = FLOW_CONTROL_DISABLED,

    };

    wiced_uart_config_t uart1_config =

      {

              .baud_rate =9600,

              .parity = NO_PARITY,

              .data_width= DATA_WIDTH_8BIT,

              .stop_bits= STOP_BITS_1,

              .flow_control = FLOW_CONTROL_DISABLED,

      };

     wiced_uart_init(WICED_UART_4,&uart_config , &rx_buffer);

    wiced_uart_init(WICED_UART_6,&uart1_config , NULL);

    while ( wiced_uart_receive_bytes(WICED_UART_4, &rx_data, &expected_data_size, WICED_NEVER_TIMEOUT ) == WICED_SUCCESS )

       {

        wiced_uart_transmit_bytes( WICED_UART_6, rx_data,RX_BUFFER_SIZE  );

       }

   }

for serial debugging i hv used wiced_uart_6 and xbee i hv connected to uart 4 ,i configured the pins to port 6.2 and 6.3 and made the changes to platform.c .

0 Likes

Dicussion moved to another thread: zigbee interfacing with psoc 6 wifi-bt pioneer kit

Regards,

Dheeraj

0 Likes