SISAM uses RTS/CTS flow control for reading command and DTR flow control for sending acquired data. This means that PC should set RTS before sending commands and watch for CTS (e.g. use CTS sensitivity option). When PIC goes into data acquisition mode, it sends an ASCII string starting with Y4-MODE:
followed with new mode description. This description can be directly used with mode
command or with BuildCommDCB
function.
PC should change the COM port mode as directed. Since the mode description contains rts=off dtr=on, DTR will be set SPACE signaling that PC is ready to receive acquired data.
PC stops Data acquisition by setting DTR to MARK and restoring 115200 baud rate.
If during data acquisition PIC encounters an error, it signals a BREAK, e.g. holds RX in SPACE until PC sets DTR to MARK. PIC does not leave error state until PC holds RTS MARK, therefore, to recover from error state, PC should restore baud rate 115200, set RTS to SPACE and read error message.
When data acquisition is performed with sync flag and PC needs to break waiting, it should alter TX line. If CTS sensitivity option is applied to COM port, WriteFile
to the port will not succeed, SetCommBreak
should be used instead. After this PIC will enter a error sate which should be cleared as stated above.
Initial state
PC opens port for normal operation: baud=115200 parity=N data=8 stop=1 octs=on dtr=off rts=of
Sending a command to SISAM
Output stream format
PIC sends acquired data as described below
S,J: | Sampled bits are packed into octets (bytes) in LSB order (less significant bit first) and sent to the output stream |
X: | Sampled bits are packed into LSB bytes and sent to the stream by turns, channel 0 comes first |
M: | Time between signal alternations is measured in ticks and sent as WORD (16 bit unsigned integer with LSB bit ordering). Zero has special meaning ??“ no alternation occurred in 0xFFFF ticks. |
Post a Comment