Regarding UART Configuration and Baud Rate in nRF9160DK Modbus RTU Sample

Hi,
   

I am writing to seek clarification regarding the UART configuration and baud rate settings used in the Modbus RTU sample code provided for the nRF9160DK.

In my exploration of the provided samples, I have encountered both the Modbus RTU client and server sample codes. While examining these samples, a specific aspect has caught my attention, and I am in need of assistance to proceed effectively.

My query primarily revolves around the UART configuration utilized within the Modbus RTU sample code. Specifically, I am uncertain as to which UART interface (UART1 or UART2) is being employed for communication. The pin assignments for UART1 are typically P0.28 (TX) and P0.29 (RX), while UART2 usually utilizes P0.00 (TX) and P0.01 (RX). Could you kindly clarify which UART interface is being utilized in the provided code?

Furthermore, I am eager to determine the baud rate configuration employed for UART communication in the Modbus RTU sample code. Understanding this setting is crucial for ensuring compatibility and seamless communication with external Modbus devices.

Additionally, I am currently using the Modscan application to view the messages transmitted by the nRF9160DK. In this context, I am seeking clarity on whether the USB interface alone is sufficient to transmit data to the Modscan application on my PC. Or, would I need to utilize a UART TTL interface and incorporate additional UART code to facilitate transmission to the Modscan application?

Your insights and guidance regarding these inquiries would be immensely valuable in my ongoing development efforts. If there are any pertinent hardware documentation or resources that could aid in resolving these queries, I would greatly appreciate access to such materials.

Thank you very much for your attention to this matter. I eagerly await your response and appreciate your assistance in addressing these uncertainties.

Best regards,
purushothaman

  • Hi,

    You can find this information by looking at the device tree.

    If you haven't done so already, I recommend that you take our nRF Connect SDK Fundamentals and Intermediate courses at our Developer Academy.

    Best regards,

    Didrik

  • Hi,

    Currently, I am utilizing the NRF sample code for a Modbus client on the NRF9160 development kit. However, I am encountering some difficulties in establishing communication with the ModScan application on the server side. Due to the unavailability of another NRF9160 development kit for the server side, I am attempting to connect via USB to serial communication.

    Despite my efforts, I am encountering errors during the connection process. Before delving deeper into debugging, I wanted to confirm whether the NRF Modbus client sample code is indeed compatible with the ModScan or any other modbus software application for sending and receiving data.

    Could you please provide clarification on this matter? Additionally, if there are any specific configurations or considerations I should be aware of when using the NRF Modbus client sample code with ModScan, I would greatly appreciate any guidance or insights you can offer.

  • The modbus sample and library comes from upstream Zephyr, and is not something that is contributed by us.

    We therefore don't have any explicit support or knowledge about them.

    Instead, I recommend that you ask the Zephyr community, as they are the ones who maintain the modbus support in Zephyr.

Related