Part Number:TMS570LC4357Other Parts Discussed in Thread:HALCOGEN
while ((canREG1->IF2STAT & 0x80U) ==0x80U)
{
} /* Wait */
for(i = 33U; i <= 64U;i++){
canREG1->IF2MSK = 0xC0000000U | (uint32)((uint32)((uint32)0x1FFFFFFFU & (uint32)0x1FFFFFFFU) << (uint32)0U);
canREG1->IF2ARB = (uint32)0x80000000U | (uint32)0x40000000U | (uint32)0x00000000U | (uint32)((uint32)((uint32)i & (uint32)0x1FFFFFFFU) << (uint32)0U);
canREG1->IF2MCTL = 0x00001000U | (uint32)0x00000400U | (uint32)0x00000000U | (uint32)0x00000000U | (uint32)8U;
canREG1->IF2CMD = (uint8) 0xF8U;
canREG1->IF2NO = i;
}
请问是在这里配置吗,具体配置哪些寄存器和哪些位
Ben Qin:
你好,请查看下手册第27章DCAN相关内容:
TMS570LC43x 16/32 RISC Flash Microcontroller Technical Reference Manual (Rev. A) (ti.com.cn)
,
?? ?:
您好,你圈出的寄存器均已经配置,配置代码如上,似乎还是没有起到滤波的作用
,
?? ?:
比如说,我将CAN邮箱1的ID号设置为8,用USB_CAN TOOL发送数据到CAN中,我想打开滤波将其滤掉,但是以上配置没法完成我想要的结果
canREG1->IF2MSK = 0xC0000000U | (uint32)((uint32)((uint32)0x00000000U & (uint32)0x1FFFFFFFU) << (uint32)0U);canREG1->IF2ARB = (uint32)0x80000000U | (uint32)0x40000000U | (uint32)0x00000000U | (uint32)((uint32)((uint32)8U & (uint32)0x1FFFFFFFU) << (uint32)0U);canREG1->IF2MCTL = 0x00001000U | (uint32)0x00000400U | (uint32)0x00000000U | (uint32)0x00000000U | (uint32)8U;canREG1->IF2CMD = (uint8) 0xF8U;canREG1->IF2NO = 1U;
,
Ben Qin:
我查看下相关资料后回复您。
,
Ben Qin:
你可以使用HALCOGEN工具来实现相关的配置:
www.ti.com/…/HALCOGEN