10-16-2007 08:30 PM
10-17-2007 01:45 PM
set it in MAX, other programming languages are possible.
DirkW
10-17-2007 06:53 PM
10-18-2007 08:55 AM
10-24-2011 03:36 AM
Hello,
What is the computation formula between decimal and hexadecimal (BTR0 & BTR1) values for baudrate ?
I am unable to compute the values for BTR0 and BTR1 to have a baudrate near to 307.690 bauds.
You think that these non-standard baudrates are accepted by the card ? Because if in NI-MAX I set non-standard values for BTR0 and BTR1 (advanced settings), they are rounded to the nearest standard values.
Cheers,
Ben
10-24-2011 04:27 AM
In Advanced mode, you can click on the "Baudrate.." button which opens a new dialog to calculate all combinations of registers for a given baudrate. Set the desired baudrate value (307.692 kBaud is supported), then click on Create List.
10-24-2011 04:47 AM
Follow-up to my last response:
You can select one of the baudrates of the list and click use, then this will be the default setting for the port.
If you wan to set the baudrate in your application, this is the information from the NI-CAN online help: "Within the application, you can use the hexadecimal baud rate of 0x8000zzyy, where yy is the desired value for Bit Timing Register 0 (BTR0), and zz is the desired value for Bit Timing Register 1 (BTR1) of the CAN controller. For assistance with creating BTR values, use the advanced dialog referenced for MAX."
10-24-2011 06:37 AM
Thank you a lot for the information.
Indeed "Baud Rate..." button in Port Properties helps me, but what are the different values computed for 307.692 kBaud ? I have to choose the one with the biggest Sample Point rate ?
And with ncSetAttr.vi I have to set only BTR0 and BTR1 ? What about BRP, TSEG1 and TSEG2 ?
Thanks again
10-24-2011 07:10 AM
BTR0 and BTR1 are two 8 bit registers and they contain BRP, TSEG1 and TSEG2.
So you only need to pick the desired value from the list and use BTR0 and BTR1.
For your case I think the last one (0x19, 0x01) with sampling point at 84.6% should be fine. All predefined baud rates use also sampling point at about 80 to 90%. The baud rate setting for SetProperty is 0x80001901.