1 year, 8 months ago.

Somebody managed to use both UARTs in nrf52840?

I'm going to buy nrf52840 becouse it has 2*UART, but before I want to know is it possible to use both UARTs with MBED. I found last year question about it https://os.mbed.com/questions/78934/How-to-use-both-UART-in-nrf52840-dev-Kit/, but there are no exact answer. As I understand, this code

Serial uart(P0_0,  P0_1);
Serial uart2(P0_3,  P0_2)

not working...

1 Answer

1 year, 8 months ago.

Hi Eugene,

It looks like a user was able to use 2 UART's on an nRF51 as shown here: https://os.mbed.com/users/kenjiArai/code/BLE_UART_pin_assign/file/f3511dc0569f/main.cpp/

I also took a look into the Mbed OS files for the NRF52840 and the following README mentions how you can utilize the UARTE instances on the NRF52840 with a custom configuration table: https://github.com/ARMmbed/mbed-os/tree/master/targets/TARGET_NORDIC/TARGET_NRF5x#customization-1

Place the following code in a file similar to the PeripheralPinsDefault.c file:

const PinMapI2C PinMap_UART[] = {
    {p0, p1, 1},
    {p3, p2, 0},
    {NC, NC, NC}

Please let me know if you have any questions!

- Jenny, team Mbed

If this solved your question, please make sure to click the "Thanks" link below!

Accepted Answer

Thank You! I have nrf51822 and will try to use 2 UARTs

posted by Eugene Basov 24 Oct 2018