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

Thingy91 UART External communication

Hi Dev Team,

I was working on the Nordic Thingy91 and had to establish an external communication of a sensor to the Thingy91 through a UART. 

For this, I was looking into the GPIO's to check which pins can be used for my Tx, Rx, CTS, RTS. 

I found this link : https://devzone.nordicsemi.com/f/nordic-q-a/64742/nordic-thingy-91-pin-name/264224#264224 that talked about using anything between P0.18-P0.25 (MCU_IF0-7).

https://github.com/nrfconnect/sdk-nrf/blob/master/boards/arm/thingy91_nrf9160/thingy91_nrf9160_common.dts#L165-L182

These are said to be connected to the nrf52840 interface. Can I just use these pins for my external UART connection ?

Also, I wanted to know the functions of these Test pads (TP). Can the test pads be also used for UART communication?

If so, how will it be defined in the thingy91_nrf9160_common.dts file. 

Regards,

Adeel.

Parents Reply
  • Hi,

    I am connecting a AST-3P device that works on Modbus protocol. So, I require a RS-485 communication through UART , using Tx, Rx, RTS, CTS. I can pin up RTS/CTS together to 1 pin so I was looking for 3 pins that I could use directly for Tx, Rx, RTS/CTS. 

    To start off, I have configured this overlay file (thingy91_nrf9160ns) in my project.

    &uart1 {
    	current-speed = <9600>; 
    	status = "okay";
    	tx-pin = <13>;
    	rx-pin = <16>;
    	rts-pin = <10>;
    };

    I also changed the thingy91_nrf9160_common.dts file with the same pin configuration using uart_1.

    Is this the only changes required to enable uart_1 in the thingy91 board ?

    Regards,

    Adeel.

Children
  • Hi Adeel,

    Make sure that the voltage from the AST-3P does not exceed the voltage on the thingy91 capability's when connecting the two over RS-485.

    Yeas that should be all.

    Regards,
    Jonathan

  • Hi Jonathan,

    Yes. I have taken that into account that the voltage should not exceed 1.8V which is what thingy91 GPIO's work with. 

    I was trying to look for more GPIO's that I could work directly with nrf9160. Are all the MCU_IF [0-7] used for modem tracing (or) can I use some pins of it without disabling the modem trace ?

    Regards,

    Adeel.

  • Hi Adeel,

    Do you have a eternal debugger? or do you plan to update the Thingy91 device with programmer app?

    another thing, it seems that you are in need of GPIO's so i would highly recommend using a nrf9160DK instead of a Thingy for development and testing external sensors. 


    The MCU_IF pins are used to communicate between the nrf9160 and the nrf52840 is the interface that connects the nrf9160 to usb. If you start cutting the SB7 to SB11 you wont have full uart 0 and 1 support.

    in the thingy91_nrf9160_common.dts file you can see that these pins are used to uart. if you can get away using only 1 then you can cut out uart1

    &uart0 {
    	compatible = "nordic,nrf-uarte";
    	current-speed = <115200>;
    	status = "okay";
    	tx-pin = <18>;
    	rx-pin = <19>;
    	rts-pin = <20>;
    	cts-pin = <21>;
    };
    
    &uart1 {
    	current-speed = <1000000>;
    	status = "okay";
    	tx-pin = <22>;
    	rx-pin = <23>;
    	rts-pin = <24>;
    	cts-pin = <25>;
    };


    If you cut all or any of the SB 7 to 11 then you will have to edit the board files also.

    Regards,
    Jonathan

  • Hi Jonathan,

    I have a nrf9160DK and I am using that as an external debugger. I have used the same sensor and was able to communicate it with the nrf9160DK, but our main requirement is to use the Thingy91 platform for further development. That is why I was in need of more GPIO's. 

    Yes, for now I am using UART_1 by modifying the overlay file. Is there also UART_2 as was the case in nrf9160DK that I could use ? I can see only uart_0 and uart_1 in the dts file.

    Regards,

    Adeel.

  • Hi Adeel,

    Adeel said:
    Is there also UART_2 as was the case in nrf9160DK that I could use ?

    No, not on the thingy91 platform. 


    The Thingy 91 is not designed for developing additional sensor on and is more of a closed solution for testing systems and the onboard sensor. If you are looking for a small form factor solution the Icarus or Feather (more information here) solutions might be more relevant.  

    Since you have a nrf9160DK then you should be able to do logging over RTT, this way you can use more of the MCU_IF if needed but you need to have the nrf9160DK connected. 

    Regards,
    Jonathan

Related