Tuesday, June 16, 2020

Narrowing in on the communications error serial USB between Arduino and Windows virtual COM port

SPY ON SERIAL DATA STREAM USING ANALOG DISCOVERY

I hooked up my Digilent Analog Discovery and put it in protocol mode, to spy on the traffic over a serial link. I hooked the two digital lines up to pins 0 and 1 of the Arduino which are the serial port RX/TX pair. Once configured for the same 115200, 8N1 I captured what came over the port.

It should have received xC0, x00, x01, x01, x00, x00, xC0 and then sent back xC0, x00, x04, x01, x01, x02, x03, x00, x00, xC0 as the response. Instead I saw this (digilent uses h instead of x to denote a hex character):

hF0 hF0 
hC0 h00 h01 h01 h00 h00 hC0 
hC0 h00 hF0 h04 h01 h01 h02 h03 hF0 h00 h00 hC0
hF0 hF8 

There are spurious xF0 characters as well as a final xF8. The occurrence in the midst of the message coming back causes my problems. 

Now, once I figure out what is injecting these and how to turn it off, I should be able to communicate cleanly. 

No comments:

Post a Comment