Saturday, June 13, 2020

3174 interface issue narrows down to either my Arduino board or some serial communications issue

REMOVING ITEMS FROM THE MIX TO HELP ISOLATE THE PROBLEM

The problems I am encountering are errors found in the Arduino firmware where it finds that a length code inside a message doesn't match the actual length. To strip away possible causes and do a binary search, Andrew suggested that I remove the shield entirely and narrow down the test to a more pure communications focus.

I modified the firmware so that when it is presented the POLL command over the USB link it returns a fixed error asserting a timeout. The error remained, a length mismatch, which tells us that problem is not in the shield nor something occurring while communicating with the 3178 terminal. 

Reducing the speed of the serial link to 9600 baud from its original 11520 eliminated whatever problem we were having, because I began to get the dummy timeout error which is the correct response. Moving up to 38400 baud reintroduced the length error (garbling). 

I swapped the USB cable for another, in case there was an electrical problem with that. No change. The range of possible culprits is shrinking. Some I can think of include:
  • Windows 10 and its driver
  • The Lenovo L340 laptop USB port hardware
  • The Sunfounder Mega 2560 clone itself
  • Some unanticipated side effect of a code flaw in the firmware
  • Some corruption in the SLIP and PYSERIAL libraries used for communications
  • Some defect in the platformio toolchain that is creating defective code
The most likely is the clone Arduino. I expect to get a name brand Arduino Mega 2560 tomorrow and will repeat the test with that. 

No comments:

Post a Comment