Set Btr
This reference collection includes Vector documentation reproduced with permission. Snippets may require configuration-specific symbols and are not all standalone programs. Sources and validation limits.
Syntax
long setBtr(long channel, byte btr0, byte btr1);
Function
Sets another baud rate. The values do not become active until the next call of the functionresetCan. It should be noted that these values depend on the CAN controller used.
Parameters
CAN channel
BTR0
Value of Bit Timing Register 0.
BTR1
Value of Bit Timing Register 1.
Return Values
Always 1
Reference example from the CANoe 12 help. This is an incomplete context fragment: omitted surrounding code is shown as comments. Do not paste it as a complete program.
// ... surrounding context omitted
setBtr(0, 0x00, 0x3a); // 500 kBaud for 82C200
resetCan(); // activate
// ... surrounding context omitted
Related APIs
resetCan | setOcr