LPC11C14 CAN_C on chip drivers

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

LPC11C14 CAN_C on chip drivers

451 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gd_starter on Fri May 10 04:09:39 MST 2013

Has anybody used the CANopen api functions with the the NXP app note AN11238?


There are so many differences/omissions between the user manual (chapter 17) and source code in the app note, I would like to hear that someone has had some success in using the api's to connect to a PLC and not just another devboard (as the appnote suggests).


For example does anyone have a better explanation for how to use the CAN_MSG_OBJ to configure message objects - in particular how to use mode_id and mask to filter message COB-ID's?

Labels (1)
0 Kudos
1 Reply

388 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Mesozoic on Tue Oct 15 16:40:20 MST 2013
I just figured this out.  The documentation isn't great, that's for sure.  This took a lot of trial and error.

Basically, in order to configure a receive CAN messages, you have to set it up with the msgobj number, the mode_id, and the mask.

Say for example you want to be able to receive all CAN messages with the following IDs: 00000EE4, 00010EE4, 00020EE4, 00030EE4, 00040EE4, and 00050EE4.
Set your mode_id = 0x00000EE4UL.  Since these are extended 29-bit messages, make sure mode_id |= CAN_MSGOBJ_EXT.
Set your mask = 0x00027FFFUL. 

Now your CAN_rx() callback should trigger.
0 Kudos