Beruflich Dokumente
Kultur Dokumente
Mostly used for connecting ECUTester, seldom ECU ECU Logic levels are relative to on board voltage (< 20% and > 80%) Bit transmission compatible to UART (Universal Asynchronous Receiver Transmitter): 1 start bit, 8 data bits, 1 stop bit, optional parity bit Bit rate 1.2 kBit/s ... 10.4 kBit/s
Dependent on ECU, not Bus Master must be able to handle multiple bit rates
> 55ms
K-Line
L-Line
Wake Up Fixed Bit Rate 10,4 kbit/s
ECU Tester
< 20ms Sync. Byte 55h Keyword LSB < 20ms Keyword MSB
< 300ms
K-Line
Adress byte
L-Line
Adress byte 5 Bit/s Fixed bit rate, chosen by ECU, detected and adopted by master
Addressing
Address length is 1 Byte Either physical address (identifies specific ECU) or logical address (identifies class of ECU) e.g., engine, transmission, ... Differentiated via format byte
8 .. 15 Destination Length
Checksum
Sum of all Bytes (mod 256)
Checksum
7
Max. Message length is 7 Byte Shall use logical addressing by tester, physical addressing by ECUs
10
Up to 110 nodes
Limited by PHY layer
ECU 1
ECU 2
ECU n
C
CAN Controller
Transceiver
CAN_H
120 120
CAN_L
[C2X] Summer 2012 Protocols: K-Line, CAN, and LIN 11
12
Branch lines max. 30 cm Terminating resistor mandated (120 ) Signal swing 2 V Error detection must happen within one Bits time bus length is limited: 1 MBit / s l 50 m data rate
[C2X] Summer 2012 Protocols: K-Line, CAN, and LIN 13
14
Bit ends
15
Trailer, 25 bit
17
Send identifier (while listening to bus) Watch for mismatch between transmitted/detected signal level
Means that a collision with a higher priority message has occurred Back off from bus access, retry later
Realization of non-preemptive priority scheme Real time guarantees for message with highest priority
i.e., message with longest 0-prefix
18
010
101
19
Client 1
Protocols: K-Line, CAN, and LIN 20
Client 2
Client 3
Bus
Client 1
Protocols: K-Line, CAN, and LIN 21
Client 2
Client 3
Bus
Client 1
Protocols: K-Line, CAN, and LIN 22
Client 2
Client 3
Bus
Client 1
Protocols: K-Line, CAN, and LIN 23
Client 2
Client 3
Bus
One node is dedicated time master node Periodically sends reference messages starting basic cycles Even if time master fails, TTCAN keeps working
Up to 7 fallback nodes Nodes compete for transmission of reference messages Chosen by arbitration
Reference Message Time Window 1 Time Window 2 Next Ref. Message
Basic cycle
[C2X] Summer 2012 Protocols: K-Line, CAN, and LIN 24
Structure of a basic cycle arbitrary, but static CAN protocol used unmodified
Throughput unchanged
25
Bit Acceptance Code Reg. Acceptance Mask Reg. Resulting Filter Pattern
10 0 1 0
9 1 1 1
8 1 1 1
7 0 1 0
6 1 1 1
5 1 1 1
4 1 1 1
3 0 0 X
2 0 0 X
1 0 0 X
0 0 0 X
26
0 SB
15
0 SB
15
Receiver checks CRC If any(!) node detects error it transmits error signal
6 dominant Bits with no stuffing
30
Automatic repeat of failed transmissions If controller finds itself causing too many errors
Temporarily stop any bus access
31
TP 2.0
Industry standard
32
Extended addressing
Uniqueness of addresses despite non-unique CAN message ID Part of transport protocol address in CAN message ID, additional address information in first Byte of TP-Header
33
0 0 0 (Address) 0 Len
4 Payload
1 Len
4 Payload
34
4 Payload
35
FS=2: Wait
Overload Sender must wait for next Flow Control Frame
37
Byte 1: Opcode
0x23: Broadcast Request 0x24: Broadcast Response
Byte 2, 3, 4:
Service ID (SID) and parameters
Byte 5, 6:
Response: 0x0000 No response expected: alternates between 0x5555 / 0xAAAA
0 Dest 1 Opcode 2 3 SID, Parameter
Protocols: K-Line, CAN, and LIN
5 0x55
6 0x55
38
Byte 1: Opcode
0xC0: Channel Request 0xD0: Positive Response 0xD6 .. 0xD8: Negative Response
Byte 2, 3: RX ID
Validity nibble of Byte 3 is 0 (1 if RX ID not set)
Byte 4, 5: TX ID
Validity nibble of Byte 5 is 0 (1 if TX ID not set)
After successful exchange of Channel Request/Response: dynamic CAN msg IDs now assigned to sender and receiver next message sets channel parameters
0 Dest 1 0xC0 2 3 1
Protocols: K-Line, CAN, and LIN
4 TX ID
5 0
6 App
40
1 BS
3 Timing
Protocols: K-Line, CAN, and LIN
41
Bytes 1 .. 7: Payload
0 6
RS 7
frame handler
Physical
[C2X] Summer 2012
Message oriented
No destination address
44
Sync Break
13 bit
LIN Identifier
Data byte
Data byte
Checksum
Sync Break
13 bit
LIN Identifier
Data byte
Data byte
Checksum
Unconditional Frame
Most simple frame type Designed for periodic polling of specific data point Exactly one slave answers LIN is a single master system timing of unconditional frames fully deterministic Sample use case:
Request did state of front left door contact change? every 15 ms Receive negative reply by front left door ECU every 15 ms
[C2X] Summer 2012 Protocols: K-Line, CAN, and LIN 48
49
Sporadic Frame
Sent (by master) only when needed Shared schedule slot with other Sporadic Frames Use whenever polling for specific data only seldom needed If more than one Sporadic Frame needs to be sent, master needs to decide for one no collision, but still non-deterministic Sample use case:
Request power window fully closed? every 15 ms ...only while power window is closing
[C2X] Summer 2012 Protocols: K-Line, CAN, and LIN 50
51
Main Takeaways
Overall
Design goals Message orientation vs. address orientation, Addressing schemes Medium access Flow control Real time guarantees and determinism
K-Line
Mainly for diagnostics Transmission uses UART signaling Communication using RequestResponse pattern
CAN
Still standard bus in vehicles Message oriented CSMA/CA with bitwise arbitration Error detection Transport layer: ISO-TP vs. TP 2.0
Flow control, channel concept Impact on determinism TTCAN (TDMA)
LIN