Author Topic: Custom CAN-FD PCB - what to watch out for?  (Read 1946 times)

0 Members and 1 Guest are viewing this topic.

Offline towe96Topic starter

  • Contributor
  • Posts: 17
  • Country: de
Custom CAN-FD PCB - what to watch out for?
« on: January 30, 2020, 08:50:09 am »
I'm designing a PCB which will communicate with a vehicle through CAN-FD at up to 2 Mbit/s.

The connection to the vehicle is made though ordinary twisted-paid CAN wire (around 2m) to a Mini Universal MATE-N-LOK connector on the board.
From there, it's approximately 15mm of 8 mil trace to the MCP2558FD CAN-FD tranciever, and approx. 6mm of trace to the termination resistors and decoupling capacitors.

The Teensy 4.0 I use for controlling this has an integrated CAN controller, but it's only available through SMD pads on the bottom side of the PCB. (https://www.pjrc.com/teensy/pinout.html)
Therefore, I soldered a short wire to those pads (~20-30mm) and plan on then soldering the wires to a hole in the PCB near the CAN transceiver (around 12mm of trace for the TX line, 5mm of trace for the RX line).

Do I need to consider anything special here? It's my first "high-speed" signal application.
Does the length / impedance of the CAN-FD traces on the board (between transceiver / connector) matter? Would the MATE-N-LOK connector be an issue? Is 2m of "external" CAN wire too much for signal quality? For now, the Teensy will only listen to messages on the bus, without receiving anything (using the MCP2558FD's "silent" mode), but I'd like to be able to send data in the future.
Is it a reasonable idea to transmit the 2 MBit/s UART (between Teensy / transceiver) through external wires? Other options (pogo pins (low availability), castellated holes (SMD components on the bottom side of the Teensy), SMD headers (different height compared to THT headers)) seemed suboptimal as well.
Could I route other signals (in this case, current signals up to around 30 mA) on the other side of the PCB, or must I retain an uninterrupted ground plane there?
« Last Edit: January 30, 2020, 08:53:07 am by towe96 »
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1356
  • Country: si
  • I like to measure things.
Re: Custom CAN-FD PCB - what to watch out for?
« Reply #1 on: January 30, 2020, 02:29:01 pm »
The CAN bus is designed to be incredibly robust and be able to handle large amounts of crap being thrown its way. You'd be surprised how bad things need to get in order for data to be corrupted on the bus.

As long as you insure that both ends of the twisted pair are properly terminated, you have nothing to worry about at 2Mbps.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 
The following users thanked this post: thm_w, towe96

Offline towe96Topic starter

  • Contributor
  • Posts: 17
  • Country: de
Re: Custom CAN-FD PCB - what to watch out for?
« Reply #2 on: January 31, 2020, 08:33:00 am »
That sounds great. I'd read about a maximum stub length of around ~0.3 online, which I would clearly surpass. But since I'm only reading data (for now), I guess that won't matter too much - as long as my tranceiver still sees the correct levels.

Would it be better to wire it as not-a-stub?
I'm connecting the 2m cable (to the PCB) between the original control unit and its original connector (using another original connector and a cannibalized control unit).
I was just going to use a T-Junction towards the PCB; meaning around 20 cm increase in bus length to the control unit, and a 2m stub. I could, of course, also bring the entire bus to the connector on my PCB and then back again (no / 10 cm stub, but a 4m increase in bus length to the real control unit.
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1356
  • Country: si
  • I like to measure things.
Re: Custom CAN-FD PCB - what to watch out for?
« Reply #3 on: January 31, 2020, 08:55:35 am »
I might have misunderstood you. You're saying that the whole 2m twisted pair is going to be unterminated at the end? Yes, that might pose problems with communication.
It doesn't have to do with whether you're sending or receiving, but with signals reflecting off the unterminated end and interfering when they get back.

If you can't properly terminate the wire you're connecting to the vehicle, it would be better to have your CAN-USB interface right next to that connector and just run a longer USB cable to your computer.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline towe96Topic starter

  • Contributor
  • Posts: 17
  • Country: de
Re: Custom CAN-FD PCB - what to watch out for?
« Reply #4 on: January 31, 2020, 10:34:23 am »
Sorry for the confusion - with the stub option, I of course planned to terminate the stub at my PCB, with 120 Ohms as outlined in the MCP2558FD's datasheet.
Should I use split termination? 60 Ohm + 60 Ohm with 4.7 nF to ground?
« Last Edit: January 31, 2020, 10:41:24 am by towe96 »
 

Offline KIKi

  • Newbie
  • Posts: 8
  • Country: hr
Re: Custom CAN-FD PCB - what to watch out for?
« Reply #5 on: January 31, 2020, 12:12:02 pm »
We have successfully tested CAN FD on the 100m CATVI cable with 500kbps (normal rate CAN) and 3000kbps (data rate CAN FD). System under test was made of 1 master node (isolated transceiver) and 20 slave nodes (unisolated transceiver). Between master and slave nodes was 100m of cable (all salve nodes were at the end of the cable). Termination on both ends was classical 120Ohm, but is better to put additional capacitor and two resistors (2x 60Ohm and 1x  a few nF - for noisy environments).

You could have some issues with slope of the CAN signal if you are not using twisted pair cable, but you can compensate this with change of slope resistor at transceiver (decrease resistor value).

For PCB design it is only important that you have normal differential routing of CAN traces (nothing special).

We had successfully tested ATSAMC21 and ATSAME51 MCUs with transceivers NXP TJF1051 and AD ADM3055E.
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 800
  • Country: lt
Re: Custom CAN-FD PCB - what to watch out for?
« Reply #6 on: January 31, 2020, 01:50:35 pm »
I agree with other posts here. There's almost nothing to be afraid of. Keep the pair close and that's it. 2Mbps is NOT high speed these days. You can be concerned beginning 200Mbps, but that is still not easy to mess up.
 

Offline towe96Topic starter

  • Contributor
  • Posts: 17
  • Country: de
Re: Custom CAN-FD PCB - what to watch out for?
« Reply #7 on: March 04, 2020, 03:48:35 pm »
I went with the stub option, with split termination - no ill effects on the bus as far as I could tell, all communication works perfectly normally. Stub length is around 3.90m.
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1356
  • Country: si
  • I like to measure things.
Re: Custom CAN-FD PCB - what to watch out for?
« Reply #8 on: March 05, 2020, 07:15:48 am »
It's not a stub if you terminated it. ::)
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf