This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Using UARTE0 and UARTE1 in different pins ?

Dear Members,

I saw this example,

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.2.0%2Fserial_uartes_example.html

I can not find this example on SDK 17,

How can I use UARTE0 and UARTE1 on separate port ? one is for debugging via USB and the other one for communicating with GPS UART ?

Any suggestions ?

Thanks

Parents
  • Hi,

    The Serial port library has been deprecated and has been replaced with the libUARTE module. We have a libUARTE example in the SDK that only uses one instance but clearly shows how to define an instance and initialize it. It should be possible to repeat this for a second UARTE instance. If you want to use two UARTE instances then you have to enable both instances in the config file and resources that the module is dependent on ( Timer and PPI) . Next you have to define an instance of the module and initialize it in the project.

    regards

    Jared 

  • I changed the configuration to :

    NRF_LIBUARTE_ASYNC_DEFINE(libuarte, 0, 0, 0, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 3);
    NRF_LIBUARTE_ASYNC_DEFINE(libuarte1, 1, 2, 2, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 3);

    but this line is not yet responding well,  :

    uint8_t data[512];

                  nrf_libuarte_async_rx_free(&libuarte1, (uint8_t *)&data, 512);
                  nrf_delay_ms(1000);
                  nrf_libuarte_async_tx(&libuarte, (uint8_t *)&data, 512);

    I want to receive from UART1 and t hen display it to UART0......

    Is it related with timer ?

    I can not find function for receiving ? where is it ? thank

Reply
  • I changed the configuration to :

    NRF_LIBUARTE_ASYNC_DEFINE(libuarte, 0, 0, 0, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 3);
    NRF_LIBUARTE_ASYNC_DEFINE(libuarte1, 1, 2, 2, NRF_LIBUARTE_PERIPHERAL_NOT_USED, 255, 3);

    but this line is not yet responding well,  :

    uint8_t data[512];

                  nrf_libuarte_async_rx_free(&libuarte1, (uint8_t *)&data, 512);
                  nrf_delay_ms(1000);
                  nrf_libuarte_async_tx(&libuarte, (uint8_t *)&data, 512);

    I want to receive from UART1 and t hen display it to UART0......

    Is it related with timer ?

    I can not find function for receiving ? where is it ? thank

Children
No Data
Related