Advanced Embedded Systems Design
Lecture 13 RISC-CISCBAE 5030 - 003
Fall 2004Instructor: Marvin Stone
Biosystems and Agricultural EngineeringOklahoma State University
Goals for Class Today
• Questions over reading / homework• Review CISC vs RISC - Ragu• J1939/ISO 11783 - (Stone)
Essence of ISO 11783an Electronics communications protocol standard
– Allows manufacturers to build electronic components that communicate with each other
• Examples:– Instrument cluster and engine Electronic Control Unit (ECU)– Tractor ECU and Implement ECU– Grain Flow ECU and Virtual Terminal ECU
– Uses multiplexed wiring• ECUs communicate across a shared four wire cable
• Bit serial communications
– Based on CAN protocol• Robert Bosch GmbH protocol for automotive use
Network Structural Model
VTTask ControllerMgt. Computer
Gateway GPS
Hitch
Implement BridgeImplement ECU and
ImplementECU
ImplementECU
Transmission
TractorECU
Engine
Implement Bus
Tractor Bus
Implement Sub-network Bus
CAN based Ag related standards
• ISO 11783 uses pieces of J1939 and DIN 9684.• At the CAN level J1939 and 11783 use the same 29
bit CAN 2.0b
ISO 11783
SAE J1939DIN 9684(LBS)
CAN 2.0a (11 bit)
CAN 2.0b (29 bit)
Mention NMEA 2000
Standards Bodies - Relationships
ISO
ANSI
Agricultural ElectronicsISO/TC23/SC19
Mobile AgriculturalCommunication Network
ISO/TC23/SC19/WG1
ANSI Designate
AMI
Technical Advisory GroupISO/TC23/SC19/WG1 TAG
(US Policy RegardingWG1)
SAE
ASAE
SAE Truck and BusElectronics Control
and CommunicationsSub-committee
Application Layer TaskForce
Data Link Layer Task Force
Diagnostics Task Force
Con Ag Task Force
About 10 Addnl. TaskForces
Instrumentation andControl (IET 353)
Mobile CommunicationsNetwork Sub-Committee
(IET 353/1)
Off-Road ElectronicsCommittee
International
National
North American ISOBUSImplementation Task
Force (NAIITF)
ISO 11783 SAE J1939
ISO 11783 Characteristics
• Attempts to• Standardize communications to the extent that ECUs built by
different manufacturers can communicate.
• Allows• Ag Implement applications (precision farming apps.)
• Powertrain/Braking/Lighting/Instrument Panel apps.
• Standardized and proprietary information exchange
• Control loops across net (10 ms repetition)
• Data rate 5.6k bytes/sec. @ 30% load, bursts to 16k bytes/sec.
• 30 nodes per subnet, 254 nodes per system
Hardware review
• How far, how fast, how many nodes• Types of nodes (if there are any). Etc.• How long of a cable can we use?
– Is this length a total length or from piece to piece?– Is there such a thing as a line driver, or booster?
• What is required in the way of line terminations?
J1939 / ISO 11783 Physical LayersMaximum number of ECU's
– 30 (per segment)• ISO 11783 Media
– Twisted Quad un-shielded• 75 nominal impedance• Two data lines (CAN_H, CAN_L)• Two termination supply lines
• J1939-11 Media– Shielded twisted pair
• 120 nominal impedance• Two data lines (CAN_H, CAN_L)• One shield
• Signal– Compatable with ISO 11898 drivers (eg. Phillips 80C250)
• Termination– J1939 – 120 passive– ISO 11783 – Active balanced current design
Cableing
Cable Cross-section
CAN_L
CAN_HTBC_PWR
TBC_RTN
Jacket
CAN_L
CAN_H
FillerShield
Filler
J1939-11 ISO-11783
ISO 11783 Physical Layer
• Bus Fault Tolerance:– Continued communications (emissions failure?)
• CAN_H shorted to Vbat or Ground or interrupted
• CAN-L shorted to Vbat or Ground or interrupted
– Communications Failure• CAN_H Shorted to CAN_L
• Terminator power interrupted
• ECU Conformance Testing– Test specifications included
Bus Length and Geometry
• Maximum Segment Length (L): 40 m• Maximum Drop Length (S): 1.0 m• Minimum Node Separation (d): 0.1 m
ECU1
ECU2
ECUn-1
ECUn
L
ECU_PW R
T erm inatingBias
C ircuit
4
4
2
4
2
4
T erm inatingBias
C ircuit
d
S
Distance 'd ' is recommended to be random, but not less than 0.1 m
ECU_G ND
ISO 11783 Connectors
Implem ent Bus
OptionalECU StubConnector
DiagnosticConnector
Tractor Bus
BusIn-CabConnector
Terminating BiasCircuit w / Netw orkPow er Connection
BusBreakaw ayConnector
E C U 1
11783P art 2
E C U 2
11783P art 2
E C U x
11783P art 2
E C U z
11783P art 2E C U y
S A EJ1939 /11
Tracto rE C U
Tractor Implem ent 1
E C U n
11783P art 2
E C Un-1
11783P art 2
E C Un-2
11783P art 2
Implem ent 2
B atte ry
OptionalAutom aticTerminatingBias Circuit
TerminatingBias Circuit
Standard Connectors
Optional Standard Connectors
Proprietary Connectors
Autom atic
BusBreakaw ayConnector
Autom atic
Automatic Terminating Bias Connector
• Disconnection does not disrupt communications• Provides Power and data
ISO 11783/J1939 Architecture
Application Layer
Presentation Layer
Session Layer
Transport Layer
Network Layer
Physical Layer
Application Layer
Presentation Layer
Session Layer
Transport Layer
Network Layer
Physical Layer
CAN CAN
Ne
two
rk M
an
ag
em
en
tNe
two
rk M
an
ag
em
en
t
Data Link LayerData Link Layer
ECU 1 ECU 2
J1939 / ISO 11783 Data Link Layer - General
– Based on CAN 2.0b 29 bit identifiers• Defines the identifier meaning
• Physical Addressing ( 256 addresses)
• Independent priority field
• Data content identifier independent of sender
• Two message structures– Type 1 - Destination Specific - both source and destination– Type 2 - Extended - Only source address
– Defines requests and acknowledgement– Defines proprietary message structure– Includes a Transport Protocol with two modes
» Managed Connection» BAM
Message Capabilities
• Two identifier types (PDUs)– ECU to ECU– ECU to All
P P P R GPDU 1
PDU 2 P P P R G
Reserved First 8 BitsBetween 240 and 255
Source AddressDestination Addr
Page Bit
TYPE
Priority
Parameter Group
Source Address-- PDU Format -- Group Extension -
Parameter Group
P P P
P P P
Destination Addr.
Source Address
Source Address
PDU Specific
Parameter Group IdentifiesData
Group ExtensionR D
R D PDU Specific
Source AddressIdentifiesSender
PDU2
PDU1
Priority
8670 Parameter Groups can be defined480 PDU1, 8190 PDU2
Identifier Structure
PGN - Parameter Group Number
Parameter Group Number (PGN)
P P P
Destination Address orGroup Extension
Source AddressR PDU Specific
PDU Specific (PS)R DP
If (PS > 239)LS Byte = PF
Else LS Byte = 0
LS Byte
DP PDU Format (PF)
0 0 0 0 0 0
Byte 2 LS ByteMS Byte
Parameter Group Number (PGN) arranged fortransmission as a parameter
Byte 2LS Byte
Identifier
PGN
PGN
PGN ArrangedMS Byte
Message Capabilities
P P PPDU1
One to ManySOURCE
DESTINATION
OR
P P PPDU2
--------- 255 ---------
- Source Address --
- Source Address --
-- Parameter Group --
-- Parameter Group --
Global
Message Capabilities
PDU1
One to One
SOURCE DESTINATION
-- Parameter Group -- Source AddressDestination Addr.PP P
Message Capabilities
P P P
AcknowledgementSOURCE DESTINATION
SEND
ACKNOWLEDGE
P P P
Command
SourceDestination
AcknowledgeACK / NACK ECU AECU B
Control Byte Reserved
1 2-5
Acknowledged orRequested PGN
Data
OrNormal Broadcast
0 = Positive Acknowledgement1 = Negative Acknowledgement2 = Access Denied3 = Cannot Respond Now No Acknowledge on Global Requests
----------- 59392 -------------
ECU A ECU B
PGN
6-8
0 1 1
PDU1
Requests
SOURCE
Destination Address
SOURCE
Source Address -
OR
DESTINATIONS
PDU1
Global
Specific
1
DataPGN lsb PGN
2 3
------- 255 ----------
Global
Request
Request
PGN msb
----------- 59904 -----------
----------- 59904 ----------- Source Address -
1
DataPGN lsb PGN
2 3
PGN msb
0 1 1
Message Capabilities
Reply’s to Requests
PDUFormat
DataLength
RequestType
Response TP Used
1 < 8 bytes DA Specific DA Specific NA1 < 8 bytes DA Global DA Global NA1 > 8 bytes DA Specific DA Specific RTS/CTS1 > 8 bytes DA Global DA Global BAM2 < 8 bytes DA Specific PDU2 Global NA2 < 8 bytes DA Global PDU2 Global NA2 > 8 bytes DA Specific DA Specific RTS/CTS2 > 8 bytes DA Global DA Global BAM
P P P
---------- 239 ----------
PDU1
Proprietary
SOURCE
Destination Address
SOURCE
Source Address
OR
P P P
----------255------------
PDU2
DESTINATIONS
--- user defined ---- Source Address
0
0
0
0
Message Capabilities
1 0 0
TP.CM_RTSRequest to Send
Source Address -Destination Address
Multi-PacketMessages
SOURCE
DESTINATION
Connection Mode
Connection Mode - START and DATA PACKETS
10
TP Control No. of Segments
161 byte
Data
1 byte 2 bytesNo. of Bytes Message PGN
3 bytes
1 0 0
TP.CM_CTSClear to Send
10
TP Control Next Segment
171 byte
Data
1 byteSegments to
Send1 byte
TP.DTPacket Data
Packetized Data7 bytes
Reserved1 byte
SENDERRECEIVER
SENDER RECEIVER
Sequence No.1 byte
TP Conn. Mgt.
--------- 236 -----------
Source Address -Destination Address--------- 236 -----------
Message PGN3 bytes
Reserved2 byte
1 0 010
SENDER RECEIVER TP Data Xfer.
Source Address -Destination Address--------- 235 --------
Data
TP Conn. Mgt.
TP.EndOf MesgACKACKNOWLEDGE
TP.ConnAbortAbort Connection
Multi-PacketMessages
Connection Mode
Connection Mode - ACKNOWLEDGE or ABORT
SOURCE
DESTINATION
1 0 0 Source Address -Destination Address10
SENDERRECEIVER TP Conn. Mgt.
--------- 236 -----------
1 0 0 Source Address -Destination Address10
SENDERRECEIVER TP Conn. Mgt.
--------- 236 -----------
TP Control No. of Segments
191 byte
Data
1 byte 2 bytesNo. of Bytes Message PGN
3 bytesReserved
1 byte
TP Control
255
Data
1 byteMessage PGN
3 bytesReserved
4 bytes
Message Capabilities
200 ms between data packets!
TP.CM_BAMBroadcastRequest to Send
Multi-PacketMessages
SOURCE
DESTINATIONBroadcast Mode
1 0 0 Source Address -Destination Address10
SENDERRECEIVER TP Conn. Mgt.
--------- 236 -----------
TP Control No. of Segments
321 byte
Data
1 byte 2 bytesNo. of Bytes Message PGN
3 bytesReserved
1 byte
TP.DTPacket Data
Packetized Data7 bytesSequence No.1 byte
1 0 010
SENDER RECEIVER TP Data Xfer.
Source Address -Destination Address--------- 235 -----------
Data
Message Capabilities
Design Recommendations
• REQUEST SCHEDULING– The scheduling of a request should be canceled if
information requested is received prior to request being sent. Parameter Groups should not be requested if they are recommended to be broadcast.
Design Recommendations
• DEVICE RESPONSE TIME AND TIME-OUT DEFAULTS– All devices, when required to provide a response, must do
so within 0.20 s. All devices expecting a response must wait at least 1.25 s before giving up or retrying.
Design Recommendations
• REQUIRED RESPONSES– A response is required for a global request from all
devices that have the requested PG, even the requester. Acknowledgments are not allowed for global requests. There is no restriction on minimum response time!
Design Recommendations
• CTS NUMBER OF PACKET RECOMMENDATION – During normal vehicle operation it is recommended that
the maximum number of packets that can be sent per CTS be set to 16.
Assignment
• Continue:– Demonstrate sending and receiving a CAN message– Prepare Portfolio
• Organize with regard to milestones in course– Review each milestone– Assess your accomplishment of each milestone
• Include resources– Lecture materials– Outside reading – assigned and other
• Commented listings