How to set the Standard frame mask When CAN initializatiion?I Set the Registers,But MASK Not work !
Hi,
how did you set registers and what is not working? Do you use global or individual mask scheme?
Mask registers can only be written in Freeze mode. The 11bit std mask is left shifted by 18bits in mask register.
BR, Petr
Hello,
I use Individual mask,and setting in Freeze mode。
For example,Can Type registers Set as 0( Standard Frame ), MB ID set as 0x7FF,mask set as 0xFFFF。after Can initialization,The MCU not only Can receive 0x7FF Standard Frame,But also Can Receive Other Standard Frame( 0x 500); So the mask Not Works。
can you share your code?
BR, Petr
Hello ! Can You show me The Correct Codes,Thanks。
can1_map.BUF[i].CS.B.IDE = 0;
can1_map.BUF[i].ID.R = 0x7FF;
can1_map.RXIMR[i].R = 0xFFFF;
Hi,
note standard ID and mask are left-shifted by 18bits in MB's ID word and mask register, so correct setting is
can1_map.BUF[i].CS.B.IDE = 0;
can1_map.BUF[i].ID.R = 0x7FF<<18;
can1_map.RXIMR[i].R = 0x7FF<<18;
BR, Petr
thanks a lot , Petr