How to receive CAN messages with the S912ZVC19F0MLF

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

How to receive CAN messages with the S912ZVC19F0MLF

968 Views
christinar
Contributor II

Hello everybody,

I'm trying to receive a CAN message with the AN4975 example code for the DEVKIT S12ZVC. I'm using CodeWarrior v11.0 and sending a message works fine.

What do I have to change in the code that I can receive a message?

Kind regards

Christina

Tags (2)
0 Kudos
2 Replies

678 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

there is a description in the application note:

"Before the CAN RX interrupt service routine can execute the callback function, the user must provide a
pointer to this function. To do this the “CAN_set_rx_callback” is called. The only parameter of this
function is a pointer to the user callback. The user callback must receive the following parameters."

So where do you see the issue?

You are not able either to use polling mode where you only manually check CAN Rx flag, then call routine

void interrupt VectorNumber_Vcan0rx CAN_ISR()  to get CAN message or you are not able to set and enable CAN Rx interrrupt together with assigning mentioned function to it.

Simple example of a can in loopback mode and polling receiver is attached.

Similar approach, just rewrite common pointers to a CANx module register to exact registers, can be used.

BR

Ladislav

0 Kudos

678 Views
christinar
Contributor II

Hi Ladislav,

Thank you very much for your help! I'm new in the field of programming and therefore I have no experience.
I tried to receive a message, but maybe I misunderstood the description with the pointer.

I will try it again.

Kind regards,

Christina

0 Kudos