J1850, Command ‘r’ – set the protocol rate, Command ‘r’ – get the protocol rate – Innovate Motorsports OT-2 SDK User Manual

Page 45

Advertising
background image

45

J1850


The general flow with J1850 Expert Mode (‘e’<2>), is:

1. Select a ‘rate’ (PWM or VPW, really selecting rate, voltage and encoding)
2. Setup filters for the J1850 packets you are interested in
3. Output a packet and (optionally) wait for a designated number of response packets


The export mode commands to accomplish these tasks are:

Command ‘R’ – Set the Protocol Rate

Sent:

2 bytes
{

U8 Cmd;

// ‘R’

U8 Rate;

// 1 = VPW

// 2 = PWM

}


Responds:

1 byte
{

U8 Result;

// Should match ‘Rate’ requested

}


Notes:

J1850 has no default rate so you must set one. In addition,
this command CAN FAIL (result does not match request). The
reason is that the command checks if the required line(s)
ever go idle. If they don’t, the command is failed, because
attempting to transmit would hang.

Command ‘r’ – Get the Protocol Rate

Sent:

1 byte
{

U8 Cmd;

// ‘r’

}


Responds:

1 byte
{

U8 Result;

// Current rate
// 0 = none
// 1 = VPW
// 2 = PWM

}


Notes:

There is no default rate for J1850 and Set Rate (‘R’) can
fail (see above).

Advertising