Nos bancs de test disposent d’une carte maison avec un PIC24FJ128GA202 qui doit jouer le rôle d’esclave Modbus RTU (adresse 7, 19200 8E1) afin qu’une passerelle puisse interroger quatre holding registers et les transmettre à Hermetry. Le transceiver est un MAX485, DE et /RE sont reliés ensemble sur RB9.Depuis la passerelle (un Pi avec pymodbus, qui fonctionnait parfaitement avec un compteur du commerce sur le même bus) je n’obtiens que des timeouts :
pymodbus.exceptions.ModbusIOException: Modbus Error: [Input/Output] No Response received from the remote slave/Unable to decode response
À l’oscilloscope, je vois la requête arriver sur la paire A/B et sur la broche RO du MAX485. Le PIC ne semble jamais réagir. Mon interruption RX de l’UART ne se déclenche pas. L’émission fonctionne : si je fais envoyer un octet de test au PIC chaque seconde, le Pi le reçoit. J’ai affecté U1RX à RP8 et U1TX à RP7 avec PPS. Je tourne en rond depuis deux jours.
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.