NI-XNET API for LabVIEW and C

Interface:64bit Baud Rate

  • 更新日2023-11-11
  • 6分で読める
 Interface:64bit Baud Rate

Interface:64bit Baud Rate

Data Type Direction Required? Default
Read/Write Yes (If Not in Database) 0 (If Not in Database)

Property Class

XNET Session

Short Name

Intf.BaudRate64

Description

Note Note  You can modify this property only when the interface is stopped.
Note Note  This property replaces the former 32-bit property. You still can use the baud rate values used with the 32-bit property. The custom 64-bit baud rate setting requires using values greater than 32 bit.

The Interface:64bit Baud Rate property sets the CAN, FlexRay, or LIN interface baud rate. The default value for this interface property is the same as the cluster's baud rate in the database. Your application can set this interface baud rate to override the value in the database, or when no database is used.

CAN

When the upper nibble (0xF0000000) is clear, this is a numeric baud rate (for example, 500000).

NI-XNET CAN hardware currently accepts the following numeric baud rates: 33333, 40000, 50000, 62500, 80000, 83333, 100000, 125000, 160000, 200000, 250000, 400000, 500000, 800000, and 1000000.

Note Note  The 33333 baud rate is supported with single-wire transceivers only.
Note Note  Baud rates greater than 125000 are supported with high-speed transceivers only.

When the upper nibble of the lower 32 bit is set to 0xA (that is, 0xA0000000), the remaining bits provide fields for more custom CAN communication baud rate programming. The fields are shown in the following table:

  63..32 31..28 27..0
Normal Res b0000 Baud Rate (33.3 k–1 M)


  63..46 45..32 31..28 27..23 22..16 15..8 7 6..0
Custom 64-bit Res Tq b1010 Res NSJW NTSEG1 Res NTSEG2
  • Time quantum (Tq), which is used to program the baud rate prescaler.
    • Valid values are 25–12800, in increments of 0x19 (25 decimal).
    • This is the time quantum from ISO 11898-1, 12.4.1 Bit Encoding/Decoding.
  • (Re-)Synchronization Jump Width (NSJW)
    • Valid values are 0–127.
    • The actual hardware interpretation of this value is one more than the programmed value.
  • Time Segment 1 (NTSEG1), which is the time segment before the sample point.
    • Valid values are 1–0xFF (1–255 decimal).
    • This is the NTSEG1 value from the Bosch M_CAN Controller Area Network User's Manual, version 3.2.1.
    • The actual hardware interpretation of this value is one more than the programmed value.
  • Time Segment 2 (NTSEG2), which is the time segment after the sample point.
    • Valid values are 0–0x7F (0–127 decimal).
    • This is the NTSEG2 value from the Bosch M_CAN Controller Are a Network User's Manual, version 3.2.1.
    • The actual hardware interpretation of this value is one more than the programmed value.

For the former 32-bit baud rate property, the following table is valid.

When the upper nibble is set to 0x8 (that is, 0x80000000), the remaining bits provide fields for more custom CAN communication baud rate programming. Additionally, if the upper nibble is set to 0xC (that is, 0xC0000000), the remaining bits provide fields for higher-precision custom CAN communication baud rate programming. The higher-precision bit timings facilitate connectivity to a CAN FD cluster.

  31..28 27..26 25..24 23 22..20 19..16 15..14 13..12 11..8 7..4 3..0
Custom b1000 Res SJW (0–3) TSEG2 (0–7) TSEG1 (1–15) Res Tq (125–0x3200)
High Precision b1100 SJW (0–15) TSEG2 (0–15) TSEG1 (1–63) Tq (25–0x3200)


  • (Re-)Synchronization Jump Width (SJW)
    • Valid programmed values are 0–3 in normal custom mode and 0–15 in high-precision custom mode.
    • The actual hardware interpretation of this value is one more than the programmed value.


  • Time Segment 2 (TSEG2), which is the time segment after the sample point.
    • Valid programmed values are 0–7 in normal custom mode and 0–15 in high-precision custom mode.
    • This 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.


  • Time Segment 1 (TSEG1), which is the time segment before the sample point.
    • Valid programmed values are 1–0xF (1–15 decimal) in normal custom mode and 1–0x3F (1–63 decimal) in high-precision custom mode.
    • This 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.


  • Time quantum (Tq), which is used to program the baud rate prescaler
    • Valid programmed values are 125–12800, in increments of 0x7D (125 decimal) ns for normal custom mode and 25–12800, in increments of 0x19 (25 decimal) ns for high-precision custom mode.
    • This is the time quantum from ISO 11898–1, 12.4.1 Bit Encoding/Decoding.

An advanced baud rate example is 0x8014007D. This example breaks down into the following values:

  • SJW = 0x0 (0x01 in hardware, due to the + 1)
  • TSEG2 = 0x1 (0x02 in hardware, due to the + 1)
  • TSEG 1 = 0x4 (0x05 in hardware, due to the + 1)
  • Tq = 0x7D (125 ns in hardware)

Each time quanta is 125 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 + 5 = 8. So, the total time for a bit in this example is 8 * 125 ns = 1000 ns = 1 µs. A 1 µs bit time is equivalent to a 1 MHz baud rate.



Formulas

Baud rate = 1/(Bit time) = [Tq (Sync_seg + TSEG1 + TSEG2)]-1

where Tq = (m)(Tq_min) = (BRP)(minimum time quantum)

Sample Point = (TSEG1 + Sync_Seg) / (TSEG1 + Sync_Seg + TSEG2)

LIN

When the upper nibble (0xF0000000) is clear, you can set only baud rates within the LIN-specified range (2400 to 20000) for the interface.

When the upper nibble is set to 0x8 (0x80000000), no check for baud rate within LIN-specified range is performed, and the lowest 16 bits of the value may contain the custom baud rate. Any custom value higher than 65535 is masked to a 16-bit value. As with the non-custom values, the interface internally calculates the appropriate divisor values to program into its UART. Because the interface uses the Atmel ATA6620 LIN transceiver, which is guaranteed to operate within the LIN 2.0 specification limits, there are some special considerations when programming custom baud rates for LIN:

  • The ATA6620 transceiver incorporates a TX dominant timeout function to prevent a faulty device that it is built into from holding the LIN dominant indefinitely. If the TX line into the transceiver is held in the dominant state for too long, the transceiver switches its driver to the recessive state. This places a limit on how long the LIN header break field that the interface transmits may be, and thus limits the lowest baud rate you can set. At the point the baud rate or break length is set for the interface, it uses the baud rate bit time and break length settings internally to calculate the resulting break duration and returns an error if that duration is long enough to trigger the TX dominant timeout.
  • At the other end of the baud range, the ATA6620 is specified to work up to 20000 baud. While you can use the custom bit to program rates higher than that, the transceiver behavior when operating above that rate is not guaranteed.

Log in to get a better experience