How to configure the Second UART port in the nRF52840 DK?

Hello,

Currently, I am working on the nRF 52840 DK and the UART port named uart0 is connected to the on board debugger, Where do i find the pins for the UART1 ? I could not able to figure it out. Please let me know how can we do this?

Parents
  • HI Teja,

    The default pin settings can be found in the DTS file.. It

    Regards,

    Swathy

  • Hi SwRa,

    Here is my project configuration

    When, I looked at the Device tree DTS file of nrf52840, the uart1 is set to arduino_serial


    arduino_serial: &uart1 {
        current-speed = <115200>;
        pinctrl-0 = <&uart1_default>;
        pinctrl-1 = <&uart1_sleep>;
        pinctrl-names = "default", "sleep";
    };

    And the pin configuration is as follows

        uart1_default: uart1_default {
            group1 {
                psels = <NRF_PSEL(UART_RX, 1, 1)>;
                bias-pull-up;
            };
            group2 {
                psels = <NRF_PSEL(UART_TX, 1, 2)>;
            };
        };

    The pins for UART1 is set to

               RX -  P1.01

               TX  - P1.02

    In case if i want to enable RTS and CTS, which pins should i configure?

    For my board, I created a device overlay file and want to enable UART1 in the overlay file. The following lines has been added.

    / {
        my_uart: &uart1 {
            compatible = "nordic,nrf-uarte";
            status = "okay";
            current-speed = <115200>;
            pinctrl-0 = <&uart1_default>;
            pinctrl-1 = <&uart1_sleep>;
            pinctrl-names = "default", "sleep";
        };
    };

    After all the settings, when i build the project, the build fails with following error

    nrf52840dk_nrf52840.overlay:14 (column 14): parse error: expected node or property name

    Do i just need to add the same settings that arduino_serial has in the overlay to configure it? Could you please suggest me how to configure this correctly?

    Thanks & Regards

    Teja

Reply
  • Hi SwRa,

    Here is my project configuration

    When, I looked at the Device tree DTS file of nrf52840, the uart1 is set to arduino_serial


    arduino_serial: &uart1 {
        current-speed = <115200>;
        pinctrl-0 = <&uart1_default>;
        pinctrl-1 = <&uart1_sleep>;
        pinctrl-names = "default", "sleep";
    };

    And the pin configuration is as follows

        uart1_default: uart1_default {
            group1 {
                psels = <NRF_PSEL(UART_RX, 1, 1)>;
                bias-pull-up;
            };
            group2 {
                psels = <NRF_PSEL(UART_TX, 1, 2)>;
            };
        };

    The pins for UART1 is set to

               RX -  P1.01

               TX  - P1.02

    In case if i want to enable RTS and CTS, which pins should i configure?

    For my board, I created a device overlay file and want to enable UART1 in the overlay file. The following lines has been added.

    / {
        my_uart: &uart1 {
            compatible = "nordic,nrf-uarte";
            status = "okay";
            current-speed = <115200>;
            pinctrl-0 = <&uart1_default>;
            pinctrl-1 = <&uart1_sleep>;
            pinctrl-names = "default", "sleep";
        };
    };

    After all the settings, when i build the project, the build fails with following error

    nrf52840dk_nrf52840.overlay:14 (column 14): parse error: expected node or property name

    Do i just need to add the same settings that arduino_serial has in the overlay to configure it? Could you please suggest me how to configure this correctly?

    Thanks & Regards

    Teja

Children
No Data
Related