04-14-2016 12:59 PM
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
Solved! Go to Solution.
04-14-2016 01:47 PM
04-14-2016 02:13 PM
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.
04-15-2016 10:51 AM - edited 04-15-2016 10:52 AM
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!
04-15-2016 12:14 PM - edited 04-15-2016 12:16 PM
@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...
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-15-2016 12:22 PM
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.
04-18-2016 12:06 PM
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
Note The 33333 baud rate is supported with single-wire transceivers only. |
Note 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
Normal | b0000 | Baud Rate (33.3 k–1 M) | |||||
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) |
An advanced baud rate example is 0x8014007D. This example breaks down into the following values:
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
04-18-2016 12:16 PM
@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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-20-2016 08:00 AM
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?!
04-20-2016 08:28 AM
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.