LPC1788: Is there any way to read all packets on CAN bus without filtering them?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC1788: Is there any way to read all packets on CAN bus without filtering them?

ソリューションへジャンプ
1,749件の閲覧回数
hhhosi
Contributor I

I have been working on LPC1788's CAN bus. I have no problem, using it in normal mode where I provide an ID and can read the received packets.

I wanted to read all packets on the CAN bus and it seems I have to use "bypass mode" to achieve this. Unfortunately, when I enter bypass mode, I cannot read any data from the CAN bus. I've tried both interrupt and polling modes.

This is the relevant section of the code:

PINSEL_ConfigPin (0, 0, 1);
 
  PINSEL_ConfigPin (0, 1, 1);
 
  //Initialize CAN1
  CAN_Init(CAN_1, 500000);  
 
  if(normal_mode) //filter mode
  {
   //Enable Receive Interrupt
   CAN_SetAFMode(CAN_NORMAL); //normal filtering mode
   CAN_IRQCmd(CAN_1, CANINT_RIE, ENABLE); //receive enable
   CAN_IRQCmd(CAN_1, CANINT_FCE, ENABLE); //full interrupt enable
   CAN_IRQCmd(CAN_1, CANINT_IDIE, DISABLE); //ID ready interrupt disable (only used for bypassmode)
  }
  else //bypass mode
  {
   CAN_SetAFMode(CAN_ACC_BP); //bypass mode get everything
   CAN_IRQCmd(CAN_1, CANINT_RIE, ENABLE); //receive enable
   CAN_IRQCmd(CAN_1, CANINT_FCE, ENABLE); //full interrupt enable
   CAN_IRQCmd(CAN_1, CANINT_IDIE, ENABLE); //ID ready interrupt enable
  }

Any help will be much appreciated.

ラベル(1)
1 解決策
1,565件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi hh hosi,

Thank you for your interest in NXP Semiconductor products and 
the opportunity to serve you.
To provide the fastest possible support, Please refer to CAN_Bypass demo in the following library to view the details.
Have a great day,

TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

2 返答(返信)
1,566件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi hh hosi,

Thank you for your interest in NXP Semiconductor products and 
the opportunity to serve you.
To provide the fastest possible support, Please refer to CAN_Bypass demo in the following library to view the details.
Have a great day,

TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,565件の閲覧回数
hhhosi
Contributor I

Thank you that made it work.

0 件の賞賛
返信