QPC protocol
Format:
Qpc358XYZ#
X - cmd, YZ - param.
Binary-oriented Param (hex) commads:
CMD358_PING 1 xx
CMD358_WA 2 0x0001-0x7CF (1-1999) write pwm A
CMD358_WB 3 0x0001-0x7CF (1-1999) write pwm B
CMD358_WI 4 0x0001-0x7CF (1-1999) write pwm I
CMD358_WO 5 0x0001-0x7CF (1-1999) write pwm opamp
CMD358_RABI 6 xx read pwm,dac,diag
CMD358_WDAH 7 0x0000-0xFFF (0-4095) write dac a hex
CMD358_WDBH 8 0x0000-0xFFF (0-4095) write dac b hex
CMD358_WCA 9 00-02 (1/4, 1/2, 3/4) write vref comp a
CMD358_WCB 10 00-02 (1/4, 1/2, 3/4) write vref comp b
CMD358_WCI 11 00-02 (1/4, 1/2, 3/4) write vref comp i
(for cmd 9,10,11, when parameters other than 00-02, default 01 is used and Ok replied)
Terminal-oriented Param (ascii) commands
CMD358_PINGT 'p' xx
CMD358_WAT 'a' 1-99 write pwm A 1-99%
CMD358_WBT 'b' 1-99 write pwm B 1-99%
CMD358_WIT 'i' 1-99 write pwm I 1-99%
CMD358_WOT 'o' 1-99 write pwm opamp 1-99%
CMD358_RABIT 'r' xx read pwm,diag
CMD358_SAVE 's' xx save to flash
CMD358_DEFAULTS 'd' xx load defaults (flash preserved)
xx - any parameters (must present) (use 00 or other)
diag bits: 01 - defaults loaded (manually or when no saved data)
02 - modified values (when commands was)
04 - flash error (erase or program) after "save" command
reply: Ok or Bad on cmd 1,2,3,4,5,7,8,'p','a','b','i','o','s'
(Ok replied if parameter is in range,
Bad replied if parameter is out of range)
reply: Ok on cmd 9,10,11,'d'
reply: 112233445 on 'r' cmd,
where 11,22,33,44 - percentage of A,B,I,opamp pwm, 5 - diag byte
reply: 11112222333344445555666677 in hex on 6 cmd,
where 1111,2222,3333,4444 - value of A,B,I,opamp pwm,
5555,6666 - DAC A,B values, 77 - diag byte
Example:
Qpc358r00# read in ascii
Qpc358a55# write 55% pwm to A
Qpc358d00# load defaults
Qpc358s00# save to flash
To save defaults to flash, use 'd' and then 's' command.
Binary oriented: 51 70 63 33 35 38 means Qpc358 in hex, 23 means # in hex
51 70 63 33 35 38 06 00 00 23 - read (cmd= 06)
51 70 63 33 35 38 09 02 00 23 - write vref3/4 to comp i (cmd= 09, param= 0002)
51 70 63 33 35 38 07 66 06 23 - write 0666 to DAC A (cmd= 07, param= 0666)
51 70 63 33 35 38 64 00 00 23 - load defaults (cmd= 64 'd')
51 70 63 33 35 38 73 00 00 23 - save to flash (cmd= 73 's')