What Clock Rate Does The NI-XNET Hardware Uses For CAN FD Communications?

Updated May 21, 2024

Reported In

Driver

  • NI-XNET

Issue Details

I am using NI-XNET hardware and Vector CAN hardware but found out there are differences in the timing register values of both devices.

I believe that this can be caused by the underlying hardware and I would like to know what clock rates NI used on the controllers and how would you translate the underlying bit timing to real-world values (such as nano and microseconds).

For example, TSEG1 = 28, what would this be in actual units of time?

Solution

XNET hardware use a 40MHz clock. Vector often have a 80MHz clock rate.

 

For example, given the following setting in Vector:

CanControllerBaudRate500k
CanControllerPropSeg47
CanControllerSeg116
CanControllerSeg216
CanControllerSyncJumpWidth16
CanBrp1
 
According to Interface:64bit Baud Rate - NI-XNET Help,
TSEG1 = PropSeg + Seg1
TSEG2 = Seg2


Thus, in NI-XNET:
TSEG147+16-1 = 62
TSEG216-1 = 15
SJW16-1 = 15
BRP*1

It can involve a bit of experimentation with XNET Database editor to find the right combination (if that combo is possible). For example, you can edit the NI Example .dbc file in NI XNET Database Editor to experiment with the numbers in the NI workflow and double check your maths. (Change the baud rate to custom and FD rate to custom and you can then modify the values to experiment).

Was this information helpful?

Yes

No