-
Notifications
You must be signed in to change notification settings - Fork 254
Description
I'm working on a project with the M5Stamp PLC (SKU: K141, based on ESP32-S3) to communicate over RS485 with a heat pump using Modbus RTU protocol (baud 9600, 8N1, no parity, as per attached protocol docs). I want to scan and detect the correct settings for a PCB to enable RS485 communication reliably. Specifically:
What options do I have to activate RS485? Is there a specific library, firmware setting, or code snippet in Arduino/ESP-IDF to enable it? The StamPLC PDF mentions PWR-485 interface, but how do I initialize it properly (e.g., via M5Unified lib or directly with HardwareSerial)?
Which pins should I use? From the PDF (page 9), it looks like:
RS485_TX: GPIO 42
RS485_RX: GPIO 43
RS485_DIR (DE/RE): GPIO 2 or 46 (avoiding GPIO 0 due to boot strapping issues)
But are these the only options? Can I remap them? And do I need external hardware like a transceiver (e.g., MAX485) or is it built-in?
Are there special settings? For example:
Pre/post TX delays (PDF suggests 100ms inter-frame)?
Pull-up resistors or termination (120Ω)?
Half-duplex mode config in code?
Any PSRAM or SPI conflicts since the PDF mentions shared pins with SD/microSD?
I need to scan/discover settings dynamically (like auto-baud or pin activity detection) to communicate with my PCB. I've tried basic configs but no luck detecting signals.