Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

PXI-8513/2 Customized Baud Rate

Solved!
Go to solution

Hello,

 

I require a Baud Rate of 667k.  The XNET Database editor and the  Bus Monitor only give options of 500k and 800k. 

 

Is there a way to specify 667000 baud rate? 

 

Thanks

0 Kudos
Message 1 of 14
(7,347 Views)

I would look at your XNET manual for updated information. The older interfaces should still work identically, but with the newer CAN FD cores, some additional options are now available.

0 Kudos
Message 3 of 14
(7,335 Views)

Thank you. 

 

Perhaps I am doing something obviously wrong? 

 

I am still getting an error.

 

I am not sure what values to use for SJW, TSEG2, & TSEG Does it matter?  If so, how would I go about knowing what to use?

 

the Baud rate I am looking for is 666000 so I used 029A

 

I have little experience with CAN/baud rate/etc.  So I appreciate any input!

 

Thanks!

Untitled.png

0 Kudos
Message 4 of 14
(7,315 Views)

@bmaki wrote:

 

the Baud rate I am looking for is 666000 so I used 029A


If the baud rate you want is 666000 why not enter 0d666000?  Why enter 0x29A which is actually 666 baud.  But looking at your picture you actually entered 0x8066029A which is actually 2154168986 baud.

 

Also...

 

0 Kudos
Message 5 of 14
(7,308 Views)

If you want 666667 baud, you have a few options:

 

(you may double-check with the docs, this is from some old material of mine, but I think it is likely correct)

80% sample point: 0xCBBB8019

83% sample point: 0xC99C0019

85% sample point: 0xC88C4019

 

 

There are others I can find, if you know your ideal sample point.

 

0 Kudos
Message 6 of 14
(7,305 Views)

http://zone.ni.com/reference/en-XX/help/372841L-01/nixnet/propertysessioninterface64bitbaudrate/ 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.

 

^ This is why I didn't just use 666667

 

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

 

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. The baud rate models are shown in the following table:

  31..28 27..26 25..24 23 22..20 19..16 15..14 13..12 11..8 7..4 3..0

Normalb0000Baud Rate (33.3 k–1 M)
Customb1000ResSJW (0–3)TSEG2 (0–7)TSEG1 (1–15)ResTq (125–0x3200)
High Precisionb1100SJW (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.

 

Thanks for the Snippet info

Message 7 of 14
(7,270 Views)

@bmaki wrote:

 

 

^ This is why I didn't just use 666667


Thank you very much, I didn't realize this was necessary when it comes to non-standard baud rates.

0 Kudos
Message 8 of 14
(7,265 Views)

GPIB_Guru,

 

how do you come up with those sample points? 

 

Looking at the User's Manual for the microcontroller, it looks like there are hundreds of options/combinations of (Re-)Synchronization Jump Width (SJW), Time quantum (Tq), Time Segment 1 (TSEG1), and Time Segment 2 (TSEG2).  Besides sitting down and trying them all, are there any other options?

 

Previously, I was using Vector CANcase hardware with CANalyzer software.  This is SOOO much easier.  I type in my desired Baud Rate and that is all that is required.   

 

I would like to transfer to NI, but they are not making it easy!  NI, if you are listening, can you add a similar functionality?!

0 Kudos
Message 9 of 14
(7,231 Views)
Solution
Accepted by topic author bmaki

Did the rates work?

 

I attached the VI that I used. It was something I wrote for my own use, so it really hasn't been polished for consumption. I have had a few versions of this over the years, and I don't have any hardware readily available so I cannot guarantee that it produces the correct results. You should probably validate that the shifts match the manual.

 

To use it, you want to look at the Max/Min Sample points to adjust to your bus needs. For CAN, this number is typically in the 80s, but it could vary based on cable length, etc.

 

You may also look at the error allowed constant. It is currently 0.6, you may increase it to be a bit more tolerant. There aren't many options at higher baud rates, 666667 is about it for the rates near there. You could consider making it a control to make it be more accessible.

 

 

If you would find something like this useful, you may add a suggestion to the team to incorporate it, or something like it.

 

Message 10 of 14
(7,226 Views)