= 通讯协议(大端模式) = ===物理层协议=== 通过UART通讯,115200波特率,校验位无,数据位8位,停止位1位。 == MCU UART 接收 通讯协议 == ====帧格式表==== {| class="wikitable sortable" |- ! 起始位(Byte0) !! 命令(Byte1) !! 数据(Byte2) !! 数据(Byte3) !! 数据(Byte4) !! 数据(Byte5)!! 数据(Byte6) !! 数据(Byte7) !! 数据(Byte8) !! (Byte9) !! (Byte10) !! (Byte11) !! (Byte12) !! (Byte13) !! (Byte14) !! (Byte15) !! (Byte16) !! (Byte17) !! (Byte18) !! (Byte19) !! (Byte20) !! (Byte21) !! (Byte22) !! 校验(Byte23) !! 长度(Byte24)!! 结束符1(Byte25) !! 结束符2(Byte26) |- |0x73||见数据位表||修改VD1电流系数||修改VD2电流系数||备用1||备用2||设置IO电平||备用3||备用4||备用5||备用6||备用7||备用8||备用9||备用10||备用11||备用12||备用13||备用14||备用15||备用16||备用17||备用18||将1-22Byte进行BCC异或校验||0x1B||0x5C||0x6E |} =====数据位表===== {| class="wikitable sortable" |- ! Byte1 |- |0xA1:读硬件版本号;
0xA2:读软件版本号;
0xA3:读VD1电流和电压、VD2电流和电压、485_1电压、485_2电压、CAN0电压;
0xA4:读IO电平状态;
0xA5:读VD1电流系数;
0xA6:读VD2电流系数;
0xA7:自动上传除了io状态的所有数据;
0xA8:清空所有历史max电压数据;
0x51:修改VD1电流系数;
0x52:修改VD2电流系数;
0x53:设置IO电平状态。 |} == MCU UART 发送 通讯协议 == ====帧格式表==== {| class="wikitable sortable" |- ! 起始位(Byte0) !! 命令(Byte1) !! 数据(Byte2) !! 数据(Byte3) !! 数据(Byte4) !! 数据(Byte5)!! 数据(Byte6) !! 数据(Byte7) !! 数据(Byte8) !! (Byte9) !! (Byte10) !! (Byte11) !! (Byte12) !! (Byte13) !! (Byte14) !! (Byte15) !! (Byte16) !! (Byte17) !! (Byte18) !! (Byte19) !! (Byte20) !! (Byte21) !! (Byte22) !! 校验(Byte23) !! 长度(Byte24)!! 结束符1(Byte25) !! 结束符2(Byte26) |- |0x73||见数据位表||VD1电流系数||VD2电流系数||IO电平状态||VD1电流-高字节||VD1电流-低字节||VD1电压-高字节||VD1电压-低字节||VD12电流-高字节||VD2电流-低字节||VD2电压-高字节||VD2电压-低字节||485_1电压—高字节||485_1电压—低字节||485_2电压—高字节||485_2电压—低字节||CAN0电压—高字节||CAN0电压—低字节||硬件版本号||软件版本号||备用1||备用2||将1-22Byte进行BCC异或校验||0x1B||0x5C||0x6E |}