ATOM RS-485 Kit - bad Rx performance?



  • I have two ATOM RS-485 Kits and both have trouble receiving data from the RS-485 bus from different senders.

    The RS-485 bus is running on +/- 3.3V, but according to the standards a difference of +/- 1.5V is the minimum signal level for RS-485.

    It feels like the adapter module is not good at handling low power signals. Has anyone had similar experiences?


  • M5Stack

    Check if there is a shared GND between devices. and make sure the A connect to A, Bconnect to B. check your program uart init pin setup is right.



  • Shared ground isn't necessar for proper RS485 action, otherwise it makes RS485 useless



  • @m5stack I do receive data, just not all of it and not consistently. Sometime there is not data received for several minutes, sometimes I'm missing single bytes and then it works again for some time.

    I have tested with 3 different devices. One is the device is want to talk to, one is a USB-to-RS485 converter, and the other is a RS485-to-RS232 (3.3V) converter connected to a ESP8266.

    Both of the other converters see the data in both directions consistently. Only the M5 hat does not.


  • M5Stack

    If you are using the atomicRS485 arduino sketch, it is virtually identical to the rs232 sketch and not particularly practical for any use case. I was having the same issue as you using the rs232 module to connect to a cisco switch, i.e there were parts missing from the transmission. I removed the delays, m5update(), from the sketch and it functioned correctly



  • Already tried that. I use a extremely simplified reader loop, and it still loses data and reads data that isn't on the wire.

    This is what I'm using:

    #include <M5Atom.h>
    
    void setup() {
      M5.begin(true, false, false);
      // Serial2.begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert)
      Serial2.begin(115200, SERIAL_8N1, 22, 19);
    }
    
    void loop() {
     if(M5.Btn.wasPressed()){
        Serial2.write('a');
     }
    
     if(Serial2.available()) {
       int ch = Serial2.read();
       Serial.printf("0x%02x\n", ch);
     }
     
     M5.update();
    }
    


  • Arghhhhhh.... it seems that is not a hardware problem after all but a issue with the Arduino core for the ESP32.

    After some more tests, I stumbled over reports of problems with hardware serial 2 on ESP32 systems. I was using the latest (1.0.4) release of the arduino-esp32 project.

    Just for fun, I've tried the master branch from repo 1, and with that branch at least my initial test show no more problems.



  • So, after many experiments I'm sorry to report that the RS-485 Atom module has very bad Rx characteristics.

    The issue of getting corrupted data was related to problems in the serial support of the arduino-esp32 project. After moving to git version I still had several problems:

    1. missing bytes
    2. zero byte at end of rx block
    3. last byte of block was sometimes corrupted

    I've then tried replacing the RS-485 Hat with another RS485-to-RS422 adapter and since then it works flawlessly. Something in the electrical design of the RS-485 hat must be messing up the Rx data.