How to receive CAN messages with the S912ZVC19F0MLF

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

How to receive CAN messages with the S912ZVC19F0MLF

1,372 次查看
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

标记 (2)
0 项奖励
回复
2 回复数

1,082 次查看
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 项奖励
回复

1,082 次查看
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 项奖励
回复