Hello all,
As detailed in the Matlab help manual (<http://www.mathworks.com/help/techdoc/matlab_external/f63744.html#f51533>) serial data consists of Control and Data signals. Control signals have an "on" state when +3V is applied and "off" state when -3V is applied, while Data signals are the opposite ("on" when -3V is applied, and "off" when +3V is applied.)
My DSP (Experimenter's kit TMS320 F28335) outputs Control signals the same way as Data signals.. i.e. both are "on" when -3V is applied, and "off" when +3V is applied. Is is possible to configure matlab to not have control signal voltages flipped?
My example that I have tried on DSP communicating with matlab through a serial port:
DSP outputs 8-bit no-parity 1-stop-bit binary stream: 1(default state) … 0(start) 00010111 1(stop)0(start) 11010100 1(stop)0(start) 11111010 1(stop) which in decimal is 23,212,160 (because 0, which is -3V, is the on state, and the least significant bit is on the left, e.g. 11111010 converted to "real binary" is 10100000.)
Matlab picks up: 1(ignored) 0(seen as default state, but was actually meant to be start bit) 000(the first 3 bits of data, but still seen as default state) 1(seen as start bit) 01111011 0(seen as stop) 1(seen as start) 01001011 111(these three bits ignored) 0(seen as stop) 1(seen as start) 01 (and then more 1's because of default voltage on th e line) which in decimal is 33, 45, 1. Note that both streams are the same, just parsed differently because matlab reverses the control signal "on" and "off" states.
TL;DR: How do I make matlab reverse the polarity it looks for of the start and stop bits?
Best Answer