FlexCAN multiple addressing to single buffer mpc55xx

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

FlexCAN multiple addressing to single buffer mpc55xx

跳至解决方案
1,623 次查看
r_james14
Contributor I

Hi There,

 

I am programming to the mpc55xx.

 

I have set up the flexcan as follows

 

pCAN_TAG->BUF[1].CS.B.IDE = 0;

pCAN_TAG->BUF[1].ID.B.STD_ID = 0x05;

pCAN_TAG->BUF[1].CS.B.CODE = 4;

 

is it possible to have multiple address go into a single buffer, for example ID 5 and ID 6?

 

Thanks

标签 (1)
标记 (3)
0 项奖励
1 解答
1,269 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

Yes, you can use the RX Mask Rregisters for that purpose. These registers are used as acceptance masks for received frame ID. See more in device Reference Manual in chapter “RX Mask Registers”.

However you cannot make an acceptance mask for incoming standard ID=5 and ID=6 only , but you can do it for  ID=5 and ID=4 for example.  In this case the mask register can be following:

RX_MASK = 0x1FF80000;

BR,

Petr

在原帖中查看解决方案

0 项奖励
3 回复数
1,270 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

Yes, you can use the RX Mask Rregisters for that purpose. These registers are used as acceptance masks for received frame ID. See more in device Reference Manual in chapter “RX Mask Registers”.

However you cannot make an acceptance mask for incoming standard ID=5 and ID=6 only , but you can do it for  ID=5 and ID=4 for example.  In this case the mask register can be following:

RX_MASK = 0x1FF80000;

BR,

Petr

0 项奖励
1,269 次查看
r_james14
Contributor I

am i correct i can only do this globally so for example i carnt do the following,

buffer 1 = 0x50 + 0x51

buffer 2 = 0x60 + 0x61

buffer 3 = 0x70 + 0x71

i know the number dont make sense but im sure you get what i trying to do,

for each device all PDO SDO so into same buffer,

thanks

0 项奖励
1,269 次查看
PetrS
NXP TechSupport
NXP TechSupport

Well, not sure I get it this time :smileyhappy:

Suppose global masking scheme; RXGMASK, RX14MASK and RX15MASK. In this scheme, MB14 and MB15 have individual masks and the others share the global mask.

So if you set the RXGMASK = 0x1FF80000 (meaning the lowest incoming standard ID bit does not care)

and set message buffers MB1-MB3 for reception with MB1 ID = 0x50, MB2 ID = 0x60 and MB3 ID = 0x70

then

incoming messages with ID 0x50 and 0x51 will match for MB1

incoming messages with ID 0x60 and 0x61 will match for MB2

incoming messages with ID 0x70 and 0x71 will match for MB3

Regards,

Petr

0 项奖励