NI-Embedded CAN for RIO API Reference

Baud Rate

Baud Rate

Data Type Direction Required? Default
Read/Write No 125000

Property Class

Embedded CAN Interface

Short Name

Baud Rate

Description

Note Note  You can modify this property only when the interface stops.

Specifies the CAN interface baud rate.

Supported Standard Baud Rates: 10000, 12500, 15625, 16000, 25000, 31250, 33333, 40000, 50000, 62500, 80000, 83333, 100000, 125000, 160000, 200000, 250000, 400000, 500000, 800000, and 1000000. (The transceiver may support only a subset of these values.)

When the upper bit is set, the remaining bits provide fields for more advanced CAN communication baud rate programming. The baud rate format in advanced mode is 0x8ABCDDDD, where A, B, C, and DDDD are defined as follows:

  • A is the (Re-)Synchronization Jump Width (SJW).
    • Valid programmed values are 0–3.
    • The actual hardware interpretation of this value is one more than the programmed value.
  • B is the Time Segment 2 (TSEG2), which is the time segment after the sample point.
    • Valid programmed values are 0–7.
    • This value is the Phase_Seg2 time from ISO 11898–1, 12.4.1 Bit Encoding/Decoding.
    • The actual hardware interpretation of this value is one more than the programmed value.
  • C is the Time Segment 1 (TSEG1), which is the time segment before the sample point.
    • Valid programmed values are 1–0xF (1–15 decimal).
    • This value is the combination of the Prop_Seg and Phase_Seg1 time from ISO 11898–1, 12.4.1 Bit Encoding/Decoding.
    • The actual hardware interpretation of this value is one more than the programmed value.
  • DDDD is the bit time quantum. Use this value to program the baud rate prescaler.
      • Single-Board RIO Hardware—Valid programmed values are 0x53–x14C0, in increments of 0x53 (83 decimal) ns.
      • CompactRIO with the Built-In CAN Port Hardware—Valid programmed values for the are 0x7D–0x7D00, in increments of 0x7D (125 decimal) ns.
    • This value is the time quantum from ISO 11898–1, 12.4.1 Bit Encoding/Decoding.

The following examples show how to break down an advanced baud rate into A, B, C, and D values for different hardware.

  • Single-Board RIO Hardware—If the baud rate is 0x82270053, you break down the rate into the following values:
    • A = SJW = 0x2 (0x03 in hardware, due to the + 1)
    • B = TSEG2 = 0x2 (0x03 in hardware, due to the + 1)
    • C = TSEG1 = 0x7 (0x08 in hardware, due to the + 1)
    • D = tq = 0x53 (83 ns in hardware)
    Each time quanta is 83 ns. From IS0 11898–1, 12.4.1.2 Programming of Bit Time, the nominal time segments length is Sync_Seg(Fixed at 1) + (Prop_Seg + Phase_Seg1)(B) + Phase_Seg2(C) = 1 + 3 + 8 = 12. So, the total time for a bit in this example is 12 * 83 ns = 996 ns ≈ 1 µs. A 1 µs bit time is equivalent to a 1 MHz baud rate.

    The real time quantum increment in hardware is 83 1/3. So, if the tq is set to be 83 * 3, the real time quantum used in the hardware is (83 1/3) * 3 = 250.
  • CompactRIO with the Built-In CAN Port Hardware—If the baud rate is 0x811C01F4, you break down the rate into the following values.
    • A = SJW = 0x1 (0x02 in hardware, due to the + 1)
    • B = TSEG2 = 0x1 (0x02 in hardware, due to the + 1)
    • C = TSEG1 = 0xC (0x0D in hardware, due to the + 1)
    • D = tq = 0x1F4 (500 ns in hardware)
    Each time quanta is 500 ns. From IS0 11898–1, 12.4.1.2 Programming of Bit Time, the nominal time segments length is Sync_Seg(Fixed at 1) + (Prop_Seg + Phase_Seg1)(B) + Phase_Seg2(C) = 1 + 2 + 13 = 16. So, the total time for a bit in this example is 16 * 500 ns = 8000 ns. The speed is equivalent to a 125 KHz baud rate.

    The execution time to read or write this property is sufficient for use in a high-priority loop in the LabVIEW Real-Time (RT) Module.

Log in to get a better experience