Unsere Testaufbauten haben eine Eigenentwicklung mit einem PIC24FJ128GA202, der als Modbus-RTU-Slave (Adresse 7, 19200 8E1) arbeiten soll, damit ein Gateway vier Holding-Register abfragen und an Hermetry melden kann. Der Transceiver ist ein MAX485, DE und /RE sind zusammen an RB9 angeschlossen.Vom Gateway (einem Pi mit pymodbus, der am selben Bus gegen ein handelsübliches Messgerät einwandfrei funktioniert hat) bekomme ich nur Timeouts:
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
Am Oszilloskop sehe ich die Anfrage am A/B-Paar und am RO-Pin des MAX485 ankommen. Der PIC scheint nicht zu reagieren. Mein UART-RX-Interrupt wird nicht ausgelöst. TX funktioniert: Lasse ich den PIC jede Sekunde ein Testbyte senden, empfängt es der Pi. Ich habe U1RX mit PPS auf RP8 und U1TX auf RP7 gelegt. Ich hänge seit zwei Tagen daran fest.
Our test rigs have a custom board with a PIC24FJ128GA202 that should act as a Modbus RTU slave (address 7, 19200 8E1) so a gateway can poll four holding registers and report them to Hermetry. Transceiver is a MAX485, DE and /RE tied together on RB9.
From the gateway (a Pi with pymodbus, tested fine against a commercial meter on the same bus) I get timeouts only:
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
On the scope I see the request arrive on the A/B pair and on the MAX485’s RO pin. The PIC never seems to react. My UART RX interrupt doesn’t fire. TX works: if I make the PIC send a test byte every second, the Pi sees it. I mapped U1RX to RP8 and U1TX to RP7 with PPS. I’ve been staring at this for two days.