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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

Jump to solution
986 Views
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.

Labels (1)
1 Solution
802 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

2 Replies
803 Views
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!
-----------------------------------------------------------------------------------------------------------------------

802 Views
hhhosi
Contributor I

Thank you that made it work.

0 Kudos