你好,我只要接收id為0x246的8個字節(jié),
設置過濾器:
? ? 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也能讀到??墒俏抑灰邮読d為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