Documente Academic
Documente Profesional
Documente Cultură
e s PCI would be 0x10 0x0A. Where 0x00A is the data length in hexadecimal (0x00A
= 10 decimal). So the first frame of a multi-frame message with 10 data bytes m
ight look like this: 0x10 0x0A 0x01 0x02 0x03 0x04 0x05 0x06. As a CAN frame ca
nnot exceed 8 bytes, we cannot write any more data to our receiving controller s
o we must send the remaining bytes in a subsequent message. But why send anymor
e data if the receiving controller is not available or busy? This is why after
we send a First Frame, we must wait for a Flow Control Frame from the controller
we are send the data to.
Flow Control Frames are responses to First Frames with information on how and wh
en to send subsequent frames. Because not all controllers are created equal, a
receiving controller may want to have the sender send ISO TP frames slowly or no
t at all. This is done via the FC frame. The FC frame has a 3 in the first por
tion of the PCI byte (i.e. 0x30 or 0x31). Unlike previous frames, the FC frame
is only PCI data; no user data is stored in this frame. The second portion of t
he first byte is either a 0 or a 1. 0 means Clear To Send (CTS) and 1 means Wait
. The Second Byte is the Block Size (BS). This is used to tell the sender how m
any Blocks (Frames) it can send before it must wait for another FC frame. This nu
mber can be between 0 and 255 where 0 means Do Not Wait (or send as many frames
as are in the message without waiting). The third and final byte in an FC frame
is the Separation Time (ST). The ST is there to tell the transmitter how long
it must wait (in milliseconds) between frames. This can be from 0-100 where 0 i
s Send As Fast As Possible. 101-255 are viable numbers, but they no longer are
in ms but rather increment at higher numbers (you can take a look the specificat
ion for more info). A typical FC frame will look like this: 0x30 00 00 or 0x30 0
4 50 and may or may not contain Padding.
The last type of frame is the Consecutive Frame. This is essentially the rest o
f the message. The first part of the PCI byte is a 2. The second part is a rol
ling counter starting at 1 and going to F then rolling over to 0. This counter
increments by 1 for each consecutive frame in the message. It is not a frame co
unter as it does roll over (or back) to 0. In the case of our previous example
of a 10 byte message a CF would look like this: 0x21 0x07 0x08 0x09 0x0A (and ma
y have padding at the end to fill the remaining bytes of the frame).
Here are some examples or Single and Multi-Frame messages:
Long Message without ISO TP:
0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D 0x0E 0x0F 0x10
0x11 0x12 0x13 0x14 0x15 0x16 0x17 0x18 (total 24 bytes)
Multi-Frame Message with ISO TP (where {To and From ArbID} are the CAN Arbitrati
on IDs not specified in the ISO specification):
{To ArbID} 0x10 0x18 0x01 0x02 0x03 0x04 0x05 0x06
First Frame
{From ArbID} 0x30 0x00 0x00 Flow Control Frame
{To ArbID} 0x21 0x07 0x08 0x09 0x0A 0x0B 0x0C 0x0D Consecutive Frame
{To ArbID} 0x22 0x0E 0x0F 0x10 0x11 0x12 0x13 0x14 Consecutive Frame
{To ArbID} 0x23 0x15 0x16 0x17 0x18 0xAA 0xAA 0xAA Consecutive Frame
Short Message without ISO TP:
0x01 0x02 0x03 0x04 0x05
Single Frame Message with ISO TP:
{To ArbID} 0x05 0x01 0x02 0x03 0x04 0x05 0xAA 0xAA
Single Frame