CAN Bus Frame reception?

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

CAN Bus Frame reception?

1,996 Views
johnwhitmore
Contributor III

[ LPC1788 uC developing with MCUXpresso and Segger J-Link ]

I'm working on the CAN Bus of the LPC1788 and it's not playing nice in terms of reception of Frames. I did a quick self test mode transmission test and that was fine so then I connected the two LPC1788 CAN Bus channels together. So both channels are on the same bus. So now I transmit a single standard frame on Channel 1, for reception on Channel 2.

The first problem is that the frame is NOT ack'd by Channel 2 of the 1788 so Channel 1 re-transmits the frame a second time. On the second transmission Channel 2 now acknowledges the frame.

The Second, and more worrying, problem is that Channel 2 never receives any frame. I'm turning on an LED when Channel 2 is receiving a frame so I can see a visual indication that Channel 2 was receiving a frame. So you'd immediately jump to the conclusion that I've not set up the suitable Acceptance Filters, for reception of the frame, but I'm in BYPASS mode so ALL frames should be received from the Bus?

I'm obviously missing something in the User Manual but my understanding is that there is only one Acceptance filter engine which is shared by the two channels. And setting it into bypass mode should be good for both channels, the code is a single line:

    Chip_CAN_SetAFMode(LPC_CANAF, CAN_AF_BYBASS_MODE);  // Bypass acceptance filters, accept all Frames

So why is no interrupt being raised for a received frame? I am getting an interrupt for the successful transmission from Channel 1, which I clear, but no interrupt is raised for any received frame. Like I say you jump to Acceptance Filters but they are bypassed.

Anybody got any ideas I'd be very grateful

Labels (2)
Tags (2)
2 Replies

1,791 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi John,

I would recommend you to take a look to the CAN_Bypass demo in the attached library for more details on how to configure the bypass mode.


Hope it helps!

Best Regards,
Carlos Mendoza
Technical Support Engineer

0 Kudos
Reply

1,791 Views
johnwhitmore
Contributor III

Hi Carlos, I actually eventually got bypass mode working. A bit of fiddling

with code and I got that sorted.

The one problem which remains, and is the more serious issue, is that

frames are not acknowledged on initial transmission and have to be

retransmitted. That means that if another node on the bus acknowledges a

frame it won't be retransmitted and the LPC will never receive that frame!

Only one of the channels is doing that but as it stands it is not a usable

CAN Bus channel.