2389214_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2389214_en-US

2389214_en-US

Energy meter on S32k144 EVB board

I am trying to interface an NXP S32K144 board with an RS-485 based energy meter using Modbus RTU.

  • S32K144 as Modbus master
  • Energy meter as Modbus slave (RS-485)
  • USB-to-RS485 converter for testing
  • S32 Design Studio (Real-Time Expression for debugging)
  1. How should I connect the RS-485 signals (A/B, DE/RE) between the S32K144 and the energy meter?
  2. How to configure UART/SCI on S32K144 for RS-485 Modbus communication?
  3. How can I verify Modbus data transfer in real time using the debugger / Real-Time Expression?

The energy meter works correctly with a PC Modbus tool via USB-to-RS485, but I need guidance for implementing and debugging it on the S32K144.

Re: Energy meter on S32k144 EVB board

Hi @Turtledove 


The S32K144 EVB does not include a native RS-485 transceiver, so you need an external RS-485 PHY (for example MAX3485, SN65HVD series, etc.) between the MCU UART and the energy meter. Connect UART TX/RX from S32K144 to the transceiver DI/RO pins, and connect the transceiver A/B differential pair to the meter A/B lines. DE and \RE can be driven by a GPIO (often tied together for half-duplex Modbus RTU operation).

For software, configure one of the LPUART instances for the meter settings (typically 9600/19200 baud, 8 data bits, no parity or even parity depending on the meter specification, 1 stop bit). Before transmitting a Modbus frame, assert DE, send the frame, wait for transmission complete, then deassert DE and switch back to receive mode. Modbus RTU itself is implemented in software on top of the UART driver.

For debugging, first verify UART traffic with an oscilloscope or logic analyzer. You can also monitor transmitted requests, received responses, CRC status, and decoded register values using watch variables or Real-Time Expressions in S32 Design Studio. Real-Time Expressions can display application variables but cannot directly decode Modbus frames on the bus.


Regards,

Lukas

Tags (1)
No ratings
Version history
Last update:
yesterday
Updated by: