RS485 problem

I get problem when used RCM5600W development kit.

Why receive buffer not empty after I’ve flush serial input buffer, then send data out?

I send data out the serial port, but the data also enter into the serial buffer. Its echo mode?

   // 1. Clear RX buffer

   // 2. Read RX buffer status, RX buffer is empty in here (it's OK)
   printf("RX BUFFER AFTER FLUSH: %d
", serXrdUsed(SER_PORT_F));  // result = 0

   // 3. Send mode

   // 4. Sending data
   serXputc(SER_PORT_F, EOT);
   serXputc(SER_PORT_F, DeviceID);
   serXputc(SER_PORT_F, POLLING);
   serXputc(SER_PORT_F, ENQ);

   // 5. Wait until data is sent

   // 6. Read RX buffer status, Why RX buffer is not empty, I clear RX buffer on top of code(step 1).
   // I see 4 characters  in RX buffer (Its problem).

", serXrdUsed(SER_PORT_F)); // result = 4

   // 7. Receive mode
   // Receive data in here

I solved the problem by changing the existing wiring in Serial Communication Accessories Board of RCM5600W.

I cut wiring from pin /RE(2) of SP3072EEN to ground(GND) and connect pin /RE(2) with pin DE(3).

By changing the wiring as above, so when we send the data out the serial port, the data actually only out, and will not go into serial buffer (echo mode). :slight_smile: