你好,我只要接收id为0x246的8个字节,
设置过滤器:
CAN_FilterInitSturcture.CAN_FilterMode = CAN_FilterMode_IdMask;//CAN_FilterMode_IdList;//;
CAN_FilterInitSturcture.CAN_FilterScale = CAN_FilterScale_32bit;//CAN_FilterScale_16bit;
CAN_FilterInitSturcture.CAN_FilterIdHigh = 0x48c0;//IDH;//0x62E0;
CAN_FilterInitSturcture.CAN_FilterIdLow = 0;//0x246<<5;246H*20H=48c0//IDL;
CAN_FilterInitSturcture.CAN_FilterMaskIdHigh =0x48D0;
CAN_FilterInitSturcture.CAN_FilterMaskIdLow =0xFFFF;//IDMSKL;// 0x0006;
可以接收,不过别的id也能读到。可是我只要接收id为0x246的。
设置
CAN_FilterInitSturcture.CAN_FilterMode = CAN_FilterMode_IdList;//CAN_FilterMode_IdMask;//;//;
CAN_FilterInitSturcture.CAN_FilterScale = CAN_FilterScale_16bit;//CAN_FilterScale_16bit;
CAN_FilterInitSturcture.CAN_FilterIdHigh = 0x246<<5;//0x48c0;
CAN_FilterInitSturcture.CAN_FilterIdLow = 0;
CAN_FilterInitSturcture.CAN_FilterMaskIdHigh =0;
CAN_FilterInitSturcture.CAN_FilterMaskIdLow =0;
一个也收不到了。
请问怎么设置才能只接收一个id?芯片是CH32V203K8T6