LPC open CAN driver - generic CAN issue

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

LPC open CAN driver - generic CAN issue

2,682 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gnxp on Tue Sep 16 08:08:58 MST 2014
Environment -
LPC1769, Keil uV4, lpc open 2.10, lpc xpresso 1769 board on a custom baseboard

I am trying to get CAN (at 500kbps) work reliably with the above setup. I am able to send and receive data. I have CANusb analyser attached to the network to monitor CAN data sent from board and in the debugger I can see CAN data received by lpc1769(received data is correct). The issue is I see lot of ERR frames. The setup runs for quite a while and then goes bus off and doesn't recover. It goes bus off quicker if it is also transmitting CAN frames. Now if I am only receiving frames and I add CANusb analyser in active mode(ACK  done) and/or a different CAN device I don't see any ERR frames(so the other devices ACK correctly).  So it is easy to conclude the ERR is on lpc1769 side. I understand all this points to a bus HW err, but I have checked soldering joints, termination resistors etc.  Next thing I would be trying is try catch CAN behaviour on scope just before err frame. I wanted to ask here if there are any gotchas I might have missed using the lpc open CAN driver. I have verified the bitrate setup which is correct. lpc1769 running at 96Mhz, CAN pclk at 24 Mhz (so BRP -1 TSEG-15 TSEG2-6  giving me 500kbps)

Any suggestions welcome.
Labels (1)
0 Kudos
Reply
7 Replies

2,566 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gnxp on Wed Sep 17 01:22:57 MST 2014
Swapped the baseboard, seems to behaving well!
0 Kudos
Reply

2,566 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gnxp on Wed Sep 17 00:56:24 MST 2014
RS pin is 10k ohms to ground, so no high speed but slope control.
0 Kudos
Reply

2,566 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Tue Sep 16 10:18:59 MST 2014

Quote: gnxp
TI's  3.3V SN65HVD230D.



Good choice, are you using its High speed mode?
0 Kudos
Reply

2,566 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gnxp on Tue Sep 16 09:55:18 MST 2014
TI's  3.3V SN65HVD230D.
Yes the bus is terminated on both sides.
I haven't really scoped TD and RD yet, was just trying to use CANH or CANL directly. Good suggestion, I will try it.
Any first's to look for you reckon?

Thank you.
0 Kudos
Reply

2,566 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Tue Sep 16 09:42:46 MST 2014
I'm not familiar with Keil, but your calculation doesn't look wrong, especially if 500kbps are transmitted  :)

You could also try to use your original setup and change it to TSEG1:16 TSEG2:5...

If changing sample point <70% and >80% doesn't show any success,that's not your problem...

First of all it's useful to check hardware (again).

Is your BUS (split-) terminated?

Which transceiver are you using?

Did you scope TD and RD signals already?

0 Kudos
Reply

2,565 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gnxp on Tue Sep 16 09:15:42 MST 2014
Ok I tried changing sampling point to 75%. I changed CAN PCLK to 16MHz and (BRP=1 TSEG1=11 TSEG2 = 2). So that should give me
(11+1)/(11+2+3) = 75% at 500Kbps.
I see a weird thing in debugging view registers in KEIL. Please see attached png. PClk_CAN2- correct at 16Mhz, BRP, TSEG1 and TSEG2 are shown correct , but debugger seems to calculate bitrate at 2Mhz(Bus timing section). I know that is not correct as I am receiving data and sending data to analyser and all are working at 500Kbps.  I still see the same err frames and as usual data as well. Do you see anything wrong with my calculation?
0 Kudos
Reply

2,565 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Tue Sep 16 08:37:18 MST 2014

Quote: gnxp
Any suggestions welcome.



Later sample point?
0 Kudos
Reply