Creating a CAN Bridge with MPC5606B

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

Creating a CAN Bridge with MPC5606B

跳至解决方案
1,128 次查看
fscheidl
Contributor II

So I am still experimenting with the MPC5606B StarterTRAK and I'm trying to create a CAN Bus bridge using the development board.

 

CAN Bus bridge is supposed to mean, I attach a second CAN transceiver to the board on another CAN port and want all incoming messages on the first port (RX), without any exception, to be forwarded to the second as output (TX) (In the right order!) and vice versa.

 

The first CAN transceiver I'm using is the one included in the system basis chip on the development board, the second one is a Microchip MCP2551. I do have a working setup for this using just a regular ATmega328 and the MCP2551, but I can't seem to get it to work with the MPC5606B.

 

The bitrate my system is using is set to 500kbit/s.

 

Now, the system kind of seems to slow or rather seems to lose some messages. I'm using the example code (CAN driver) included with the development board with the RX-mask set accordingly. Would it be better to use a FIFO CAN structure in this case? Are there any other things I have to consider?

 

Thank you very much in advance!

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
932 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I am not sure of the driver/example you are using, but still you need some CPU intervention to

- check there is new message in RX MB or RXFIFO

- read RX MB or RXFIFO and forward the data to other module’s TX MB. Message will be send on first opportunity window on the CAN bus.

 

The MB interrupt or RXFIFO interrupt is recommended here as fastest way to know a new message is received.

The RXFIFO can ensure the messages will be send in right order, I think.

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
1 回复
933 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I am not sure of the driver/example you are using, but still you need some CPU intervention to

- check there is new message in RX MB or RXFIFO

- read RX MB or RXFIFO and forward the data to other module’s TX MB. Message will be send on first opportunity window on the CAN bus.

 

The MB interrupt or RXFIFO interrupt is recommended here as fastest way to know a new message is received.

The RXFIFO can ensure the messages will be send in right order, I think.

BR, Petr

0 项奖励
回复