您好!
CapTIvate MCU 开发套件的手机板演示
轻触传感器值变为0x55的点
当通过 UART 从 MSP430FR2633向 PC 发送数据时、
获取了与所附数据类似的数据。
55 AA 08 00 55 55 00 00 0 F 64 00
其中、传感器数据变为0x55
无论字节数设置为8、都是如此
它是9字节。
如何解决?
此致
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好!
CapTIvate MCU 开发套件的手机板演示
轻触传感器值变为0x55的点
当通过 UART 从 MSP430FR2633向 PC 发送数据时、
获取了与所附数据类似的数据。
55 AA 08 00 55 55 00 00 0 F 64 00
其中、传感器数据变为0x55
无论字节数设置为8、都是如此
它是9字节。
如何解决?
此致
您好!
随附的文件是客户发送的 CapTIvate 设计中心文件
另一个是针对 CapTIvate EVM 进行了修改的项目。
由于原始项目是要在客户的电路板上使用的项目、因此为了在此处重现此项目、我们只更改引脚排列以与手机电路板一起移动。
MSP 430和 PC 之间通信的波特率为250、000。
在使用手机板进行检查时、
当 WHL00的传感器值为80 (0x55)时、数据包变为非法。
尽管有源代码请求、但它会成为随附的 CCS.zip。
解压缩后、有 modify_TO_captate_phone_from _original 文件夹、源代码是从其中 captate 设计中心的项目创建的
它将是一个项目。
您好、DDDOOR、
此数据包打算由 HID 桥解析并发送到 GUI。 您可以将此格式用于软管处理器或禁用与 HID 桥的通信、只需使用您自己的数据格式即可发送数据。
我在此附上了 HID 桥中用于解析数据包以供您参考的代码。
#define MAX_PACKE_LENGTH (62) typedef 结构 { uint8_t ui8有效载荷[MAX_PACKET_LENGTH]; uint8_t ui8Length; }tPacket; bool HIDBridge_parseQueueForPacket (tByteQueue * pReceiveQueue、tPacket * pPacket) { 静态 INT8_t g_i8currPacketIndex =-1; 静态 bool g_bStudioedByteDetected = false; bool bChecksumVerified = false; // //如果没有数据包开始成帧,请检查是否开始成帧 //字节已准备好进行检查 // if (g_i8currPacketIndex < 0) { while (ADT_getByteQueueSize (pReceiveQueue)> 2) { if (ADT_PULLEFromByteQueue (pReceiveQueue)!= HIDBRIDGE_SYNC) { __no_operation(); 继续; } if (ADT_PULLFromByteQueue (pReceiveQueue)== HIDBRIDGE_SYNC) { __no_operation(); 继续; } pPacket->ui8Length = ADT_PULLFromByteQueue (pReceiveQueue); if (pPacket->ui8Length > MAX_PACKE_LENGTH) { G_i8currPacketIndex =-1; 返回 false; } G_i8currPacketIndex = 0; 中断; } } // //如果数据包启动,则开始成帧 // if (g_i8currPacketIndex >= 0) { while (ADT_getByteQueueSize (pReceiveQueue)> 0) { pPack->ui8有效载荷[g_i8currPacketIndex]= ADT_PULLEFromByteQueue (pReceiveQueue); if (g_BStudioedByteDetected = true) { if (pPack->ui8有效载荷[g_i8currPacketIndex] =HIDBRIDGE_SYNC) { G_i8currPacketIndex++; G_bStudioByteDetected = false; } 其他 { G_i8currPacketIndex =-1; G_bStudioByteDetected = false; 返回 false; } } 否则(pPack->ui8有效载荷[g_i8currPacketIndex] =HIDBRIDGE_SYNC) { G_bStudioByteDetected = true; } 其他 { G_i8currPacketIndex++; } if (g_i8currPacketIndex =pPack->ui8Length) { G_i8currPacketIndex =-1; bChecksumVerified = HIDBridge_verifyChecksum (pPacket); 中断; } } 返回 bChecksumVerified; } bool HIDBridge_verifyChecksum (tPacket *pPacket) { uint16_t ui16计算、ui16指定; uint8_t ui8Index; ui16已指定= (pPacket->ui8有效载荷[pPacket->ui8Length -2) |(pPacket->ui8Payload[pPacket->ui8Length -1]<<8); ui16计算= 0; 对于(ui8Index=0;ui8Index ui8Length -2;ui8Index++) { ui16计算+= pPacket->ui8有效载荷[ui8Index]; } if (ui16已指定=> ui16已计算) { 返回 true; } 其他 { 返回 false; } }
谢谢、
是的