FAQ Network
FAQ Network
Message Identifier – 11 bit (CAN base frame format) or 29 bit (CAN Extended frame format)
The 29 bit message identifier consists of the regular 11 bit base identifier and an 18 bit
identifier extension. The distinction between CAN base frame format and CAN extended frame
format is accomplished by using the IDE bit inside the Control Field. A low (dominant) IDE bit
indicates an 11 bit message identifier, a high (recessive) IDE bit indicates a 29 bit identifier.
An 11 bit identifier (standard format) allows a total of 211 (= 2048) different messages. A 29
bit identifier (extended format) allows a total of 229 (= 536 million) messages
The above picture shows a comparison between a standard CAN data frame with an 11-Bit identifier
and a CAN data frame in extended format (29-Bit identifier). Both frames contain an Identifier
Extension Bit (IDE)3, which is at low level for the standard frame and at high for the extended data
frame. CAN controllers must be designed in a way that they check the IDE in order to distinguish
between the two possible frame formats.
Both formats, Standard (11 bit message ID) and Extended (29 bit message ID), may co-exist on the
same CAN bus. During bus arbitration the standard 11 bit message ID frame will always have higher
priority than the extended 29 bit message ID frame with identical 11 bit base identifier and thus gain
bus access.
J1939 Features
Higher-Layer Protocol using CAN as the physical layer
Shielded twisted pair wire
Max. network length of 40 meters (~120 ft.)
Standard baud rate of 250 kBit/sec
Max. 30 nodes (ECUs) in a network
Max. 253 controller applications (CA) where one ECU can manage several CAs
Peer-to-peer and broadcast communication
Support for message length up to 1785 bytes
Definition of Parameter Groups (Predefined vehicle parameters)
Network Management6 (includes address claiming procedure.
It must be emphasized that the maximum network length of 40 m (roughly 120 ft.), the baud rate of
250 kBit/sec and the maximum number of nodes (30) are self-inflicted restrictions by the SAE, most
probably with the intention to keep everything on the extreme safe side and thus trying to prevent
potential runtime problems.
In all consequence, the network length at 250 kBit/sec, according to ISO 11898, is 250 m (roughly
750 ft.).
There is no reason to believe that J1939 cannot be operated at the max. CAN baud rate of 1 MBit/sec.
Naturally, the network length would drop, but the mere J1939 protocol features post no restriction in
regards to the baud rate.
The J1939 protocol utilizes an 8 bit device (ECU) address, which would allow the operation of 256
nodes in the same network. It can only be assumed that the SAE was trying to keep the bus traffic on
a low level by restricting the maximum number of nodes to 30. Elaborating comments on this
restrictions may be embedded somewhere in the standard.
As shown in the picture J1939 extends the use of the 29-Bit CAN identifier beyond the standard CAN
message identification. The CAN identifier is split into a priority field, a Parameter Group Number
(PGN) to identify the content of the data field, and the source address.
A message priority ‘0’ indicates highest priority and a message priority of ‘7’ indicates lowest priority.
High priorities are usually assigned to time-critical data such as torque control.
The first three bits in the identifier represent the priority during the arbitration process, thus providing
eight priority levels. In compliance with the CAN standard a value of 0 (000) has the highest priority;
a value of 8 (111) has the lowest priority.
Communication methods
SAE J1939 provides three communication methods, each serving a specific purpose.
Parameters groups are, for instance, engine temperature which includes coolant temperature,
fuel temperature, oil temperature, etc. Parameter Groups and their numbers (PGN) are listed
in SAE J1939 (roughly 300 pages) and defined in SAE J1939/71.
With the definition of PDU Format (PF) and PDU Specific (PS) – as shown below - J1939
supports a total of 8672 Parameter Group numbers.
The Parameter Group Number range is divided into two sections:
1. Specific PGNs for peer-to-peer communication (PDU1 Format)
Range: 00hex - EFhex (not including PDU Specific)
Number of PGNs: 240
2. Generic PGNs for message broadcasting (PDU2 Format)
Range: F000hex – FFFFhex (including PDU Specific)
Number of PGNs: 4096
Considering the Data Page (DP) bit, the total number of PGNs is (240 + 4096) * 2 = 8672.
The current range of Parameter Group Numbers as defined in SAE J1939/71 is from PGN 0
(Torque/Speed Control) to PGN 65279 (Water in Fuel Indicator). This range is not a real
representation of the total number of PGNs, since there a gaps between PGN definitions. The
same is true for SPNs, who range from SPN 16 (Engine Fuel Filter) to SPN 4096 (XBR
Urgency).
Sl.No Parameters CAN identifier byte details PGN no SPN
Engine Water
2 Temperature (Coolant 0x18 FE EE 00 Byte 1 65262 110
temperature)
Sea Water
5 Not available - - -
Temperature
Turbo Coolant
6 Temperature /Engine 0x18 FE EE 00 Byte 3 & 4 65262 175
Oil temperature
CANALYZER DATA
Controller Area Network (Frequently Asked Questions)
2. Describe the control field in CAN message frame in both standard and extended modes.
The Control field contains 6 bits. The first two bits are reserved or predefined in content. In the
standard message format the first bit is the IDE (Identifier Extension bit), followed by a reserved
bit. The IDE bit is dominant in standard formats and recessive in extended formats. It ensures
the deterministic resolution of the contention (in favor of standard frames) when the first
eleven identifier bits of two messages (one standard, one extended) are the same. In the
extended format there are two reserved bits. For these bits, the standard specifies that they are
to be sent as recessive, but receivers will accept any value (dominant or recessive). The
following four bits in the data frame define the length of the data content (Data Length Content,
or DLC) in bytes. If the dominant bit is interpreted as 1 (contrary to the common notation in
which it is read as 0) and the recessive as 0, the four DLC bits are the unsigned binary coding of
the length (Fig. 2).
The CRC portion of the frame is obtained by selecting the input polynomial (to be divided) as the
stream of bits from the start of frame (SOF) bit (included) to the Data field (if present) followed
by 15 zeros.
This polynomial is divided by the generator polynomial
The remainder of the division is the CRC sequence portion of the frame. The ACK field consists of
two bits. The first bit has the function of recording acknowledgments from receivers (ACK slot).
The other bit is a delimiter (one bit of bus recessive state). The receivers that have validated the
received message signal their acknowledgement to the sender by overwriting the recessive bit
sent in the ACK slot by the transmitter with a dominant bit.
8. Pictorially show the CAN arbitration for three nodes whose identifiers are 0x15A, 0x3D2, 0x1F6.
9. If the identifier for a received message is 0x03AA and the mask register is programmed with
0x0538 and there are two acceptance filters a) 0x1EB (filter1) b) 0x6AD (filter2). Find the
received data in the buffers RxObject1 and RxObject2.
Nodes define message filters that can accept the received data and store in the registers
RxObject1 and RxObject2 based on the acceptance filters filter1 and filter2. A reception mask
specifies on which bits of the incoming message identifier the filters should operate to detect a
possible match. A bit at 1 in the mask register usually enables comparison between the bits of
the filter and the received id in the corresponding positions. If there is a match between the
transmitted ID and the filter at the masked id bit positions then the identifier is accepted at the
RxObject as seen in above figure.
Looking from LSB position as Bit0 and MSB as Bit 10, it can be seen that the mask of 0x538
specifies compare the bits Bit3,Bit4,Bit5,Bit8 and Bit 10 between the identifier and the filter. If
these bits match then the identifier is accepted into the RxObject1. In this case RxObject1 gets
the identifier.
10. How does a node acknowledge reception of a CAN frame?
The protocol requires that receivers acknowledge reception of the message by changing the
content of the ACK field. Upon successful reception, the first bit (ACK slot), which is sent as
recessive, must be overwritten as dominant.
The error flag form violates the bit stuffing rule and/or destroys the fixed form ACK or End of
Frame fields. As a consequence, all other stations detect an error condition and start
transmitting an error flag in turn. Hence, the sequence of dominant bits (which actually can be
monitored on the bus) results from a superposition of different error flags transmitted by
individual stations. The total length of this sequence varies between a minimum of six and a
maximum of twelve bits. The passive error flag sent by error passive nodes has effect on the bus
only if the error passive node is the transmitting node, which avoids a possible interference from
the node on the transmissions of other nodes. Also, the error passive signaling node has to wait
for six consecutive bits of equal polarity, beginning at the start of the passive error flag, before
continuing. This additional delay clearly impacts its capability of participating in the very next
contention, increasing the delays of its outgoing messages. The recovery time from the time
instant an error is detected, until the start of the next message is at most 31 bit times, that is, if
there is no further error.
The CAN protocol includes a fault confinement mechanism that detects faulty units and places
them in passive or off states, so that they cannot affect the bus state with their outputs. The
protocol assigns each node to one of three states:
• Error active: units in this state are assumed to function properly. Units can transmit on the bus
and signal errors with an Active Error flag.
• Error passive: units in this state are suspected of faulty behavior (in transmission or reception).
They can still transmit on the bus, but their error signaling capability is restricted to the
transmission of a Passive Error flag.
• Bus off: units in this state are very likely corrupted and cannot have any influence on the bus.
(e.g. their output drivers should be switched off.) Units change their state according to the value
of two integer counters, Transmit Error Count and Receive Error Count, which give a measure of
the likelihood of a faulty behavior on transmission and reception, respectively.
14. What are the rules for updation of error counts for the receiver and transmitter?
Parameter groups are classified according to the transmission mode. They can be transmitted
point-to-point or broadcast. Each group has a 16-bit number (PGN - Parameter Group Number)
as an identifier. The PGN defines the type of the PDU (Protocol Data Unit) and is encoded in the
CAN identifier of the transmitted message. The PDU and PGN format depends upon the type of
the transmitted group. If the parameter group is of type broadcast, then the first 8 bits of the
PGN must be greater than or equal to 240 (the first four bits must be 1, that is, the hex coding
must be greater than 0x0F0). The other 12 bits of the PGN can be freely defined (leaving 212 =
4096 broadcast identifiers available). If the group is of type point-to-point, that is, the values are
meant to be sent to specific devices, then the 8 lower order bits identify the destination address
and only the first 8 bits can be used to specify the PGN (with the restriction that the value must
be lower than 240). Special destination addresses are 254, indicating no node (mainly used in
the address claiming procedure), and 255, indicating the entire network, which makes it a
broadcast message disguised as point-to-point. Available PGNs is 4096+240 = 4336. These
definitions are for Data Page 0. An identical set can be made for Data Page1 therefore doubling
the PGNs to 8672 PGNs.
21. Where is the PGN, PDU located in the CAN 29 bit identifier?
The CAN message identifier starts with three bits indicating the message priority (0-highest, 7-
lowest), followed by one reserved bit and one Data Page bit. After that, the PGN (and PDU
format) is defined, followed by the address (8 bit) of the source node.
22. How do the nodes react to Data request or broadcast or node to node commands?
In J1939, the exchange of information can be driven by a data request from the receiver, or it
may happen because the sender decides autonomously and independently to initiate a
communication.
• If a message is a destination-specific request or command, the receiving device filters
messages for which the destination address matches one of its addresses. After processing the
message, the node typically provides some type of acknowledgment.
• If a message is a global request, every device, even the originator, must process the request
and respond if the data is available.
• If a message is of broadcast type, each device receives the data and then it may decide
whether to use the transmitted information.
23. What happens if a node does not have a data value when requested to send the data?
The data part of the message contains the parameter value. When a device does not have data
available for a given parameter, the bytes that are allocated to the missing parameter are set to
the predefined value 0x0FF (meaning not available) so that receivers know that the sender did
not have the corresponding piece of information, as opposed to a possible protocol error.
24. How is an ECU defined in J1939 protocol?
The most important function in J1939 Network Management is the Address Claiming Process.
Each ECU in a J1939 vehicle network is uniquely identified by a 64-bit name that also indicates
the ECU main function. The ECU name is indeed a structure, and it is composed of ten fields, as
shown. An ECU name is statically assigned by the manufacturer to each J1939 device. The ECU
name is not meant to be used as an address inside the CAN messages (it would be clearly
impractical since it would consume all the 8 bytes in the CAN data field). For the purpose of
expressing an address inside a PDU (a message), each ECU also has a shorter 8-bit address. ECU
addresses are typically predefined, assigned statically and used immediately upon power up.
Request for Address Claim. In this case, the device that needs an address sends a Request for
Address Claim, that is, a special broadcast message (with destination address equal to 255. The
requesting node does not have an address yet and uses the NULL address (254) as its source
address in the PDU. All the other devices in the network respond by transmitting their addresses
inside an Address Claimed J1939 message. This allows the requesting device (typically a
transitional devices such as a tool or a trailer or a device that powered up late) to obtain the
current table of all the addresses in use in the network so that it can select a free address and
claim it using an Address Claim Message.
Address Claim Message. The destination address for an address claim is the global address (255)
to broadcast to all nodes. The requesting node is now using the claimed address as its source
address and sends its name as the data content of the message. All receiving devices compare
this newly claimed address to their own table of devices in the network. In the event that more
than one ECU attempts to claim the same address, the ECU with the lowest name has the
highest priority. In case one of the receivers has a conflicting address and higher priority, it
notifies the sender with an Address Claim Message indicating that the address is already in use.
The remaining ECUs must claim a different address by sending another Address Claimed
Message containing a different address or send a Cannot Claim Address Message.
The nature of CAN bus communications allows all modules to transmit and receive data on the
bus. Any module can transmit data, which all the rest of the modules receive permitting both
peer-to-peer and broadcast data transmissions. In CANopen, the CAN bus normally includes one
module acting as a network master which starts the bus communications, but a dedicated
master module is not needed. In J1939, the master and slave concept is not used.
29. What is the practical limit of data throughput on the CAN bus?
CAN bus can use multiple baud rates up to 1 Mbit/s. The most common baud rates are 125
kbit/s (default CANopen) and 250 kbit/s (J1939). The CAN bus communication enables bus loads
of up to 100% (data being transmitted all the time and all nodes can transmit), allowing full
usage of the nominal bit rate
CAN bus is a synchronous network, where all receiving modules synchronize to the data coming
from a transmitting module. The electrical characteristics of the CAN bus cable restrict the cable
length according to the selected bit rate. You can use cabling up to 250 meters with the baud
rate of 250 kbit/s. The maximum bus length with a bit rate of 10 kbit/s is 1 km, and the shortest
with 1 Mbit/s is 40 meters.
In standard industrial environments, the CAN bus can use standard cabling without shielding or
twistedpair wiring. If very low EMI is required, a twisted-pair cable is recommended. However,
this will normally not be required in most applications.
In CANopen, there are unique addresses available for up to 127 nodes on the bus. However the
practical physical limit of nodes is about 110 units per bus. In J1939, there are 253 unique
addresses available for the bus.
33. Can I use units from different vendors in the same system?
Yes. If the same higher-level protocol such as CANopen or J1939 is used by all the modules on
the bus, you can mix components from different vendors in the same control system without
software changes.
34. Where can I get more information about CAN? The higher-level protocol support organizations
provide information about CAN bus, protocols and keep a database of CAN bus products. The
CANopen protocol is developed by CiA (CAN in Automation) at www.can-cia.org. SAE (Society of
Automotive Engineers) can provide information about the J1939 protocol at www.sae.org.
CAN_FD
2. What prevails if a data frame and remote frame are sent with the same identifier?
The data frame prevails over the remote frame when two nodes with the same identifier sends
messages in the bus.
3. Distinguish between the lengths/data rates of arbitration and control field in various CAN
formats.
There are four different formats which differ in the length of the ARBITRATION FIELD and
in the CONTROL FIELD:
CAN BASE FORMAT: 11 bit long identifier and constant bit rate
CAN EXTENDED FORMAT: 29 bit long identifier and constant bit rate
CAN FD BASE FORMAT: 11 bit long identifier and dual bit rate
CAN FD EXTENDED FORMAT: 29 bit long identifier and dual bit rate
ARBITRATION FIELD
The structure of the ARBITRATION FIELD is different for BASE FORMAT and EXTENDED FORMAT
frames, but there is only one different bit in CAN format and CAN FD format.
• InBASE FORMAT the ARBITRATION FIELD consists of the BASE IDENTIFIER and the RTR
bit (CAN format) or the r1 bit (CAN FD format). The BASE IDENTIFIER is 11 bits long,
denoted ID-28…ID-18.
• InEXTENDED FORMAT the ARBITRATION FIELD consists of the EXTENDED IDENTIFIER,
the SRR bit, the IDE bit, and the RTR bit (CAN format) or the r1 bit (CAN FD format).
The EXTENDED IDENTIFIER consists of two sections, the first section is the BASE IDENTIFIER
(denoted ID-28…ID-18), the second section is the IDENTIFIER EXTENSION (18 bits long, denoted
ID-17…ID-0).
6. How is the IDE different in CAN base format and extended format?
The IDENTIFIER EXTENSION FLAG (IDE) belongs to
• the ARBITRATION FIELD for the EXTENDED FORMAT
• the CONTROL FIELD for the BASE FORMAT,it distinguishes between the formats. The IDE bit is
transmitted dominant in the BASE FORMAT, whereas in the EXTENDED FORMAT the IDE bit is
recessive.
7. How does the SRR bit resolve collisions between base format and extended formats?
The SUBSTITUTE REMOTE REQUEST (SRR) bit is recessive. It is transmitted in EXTENDED
FORMAT at the position of the RTR bit in BASE FORMAT. Therefore, collisions of a frame
in BASE FORMAT and a frame in EXTENDED FORMAT, the BASE IDENTIFIER of which is the
same in both frames, are resolved in such a way that the frame in BASE FORMAT prevails
the frame in EXTENDED FORMAT.
8. How is RTR bit used to resolve the contention between data frame and remote frame?
The REMOTE TRANSMISSION REQUEST (RTR) bit only exists in CAN format frames. It has
to be dominant within DATA FRAMES and has to be recessive within REMOTE FRAMES. In
CAN FD format frames, it is replaced with the dominant reserved bit r1. There are no
REMOTE FRAMES in CAN FD format.
9. How is the control field different between the various CAN formats?
The structure of the CONTROL FIELD is different for CAN BASE FORMAT, CAN FD BASE FORMAT,
CAN EXTENDED FORMAT, and CAN FD EXTENDED FORMAT frames.
a)In CAN BASE FORMAT the CONTROL FIELD consists of the bits IDE, r0, and the 4 bits
wide DATA LENGTH CODE (DLC).
b)In CAN FD BASE FORMAT the CONTROL FIELD consists of the bits IDE, EDL,r0, BRS, ESI,
and the 4 bits wide DATA LENGTH CODE (DLC).
c) In CAN EXTENDED FORMAT the CONTROL FIELD consists of the bits r1, r0, and the 4
bits wide DATA LENGTH CODE (DLC).
d)In CAN FD EXTENDED FORMAT the CONTROL FIELD consists of the bits EDL, r0, BRS,
ESI, and the 4 bits wide DATA LENGTH CODE (DLC).
10. What are the EDL,BRS, ESI fields, r0 and r1 in CAN-FD format?
EDL: EXTENDED DATA LENGTH (EDL) bit is recessive. It only exists in CAN FD format
frames, it distinguishes between CAN format and CAN FD format frames. In a CAN format frame, the
dominant bit r0 is transmitted instead of EDL. In frames with 11-bit identifiers, EDL comes after the
IDE bit, in frames with 29-bit-identifier, it comes after the r1 bit. EDL is always followed by the
dominant bit r0, which is reserved for future expansion of the protocol.
BRS: The BIT RATE SWITCH (BRS) bit decides whether the bit rate is switched inside CAN FD format
frame. If the bit is transmitted recessive, the bit rate is switched from the standard bit rate of the
ARBITRATION PHASE to the preconfigured alternate bit rate of the DATA PHASE. If it is transmitted
dominant, the bit rate is not switched. BRS does not exist in CAN format frames.
ESI: The ERROR STATE INDICATOR (ESI) flag is transmitted dominant by error active nodes,recessive
by error passive nodes. ESI does not exist in CAN format frames.
ro,r1: The reserved bits r1 and r0 have to be sent dominant. Receivers accept dominant and
recessive bits in all combinations. Receivers also accept dominant SRR bits.
The first nine codes for the four bit Data length code are similar for CAN and Can-FD. CAN-FD
can specify up to 64 data bytes in one frame while CAN messages have a limit of 8 data bytes.
12. What are the various CRC polynomials used in CAN FD formats?
A CAN FD node uses different CRC generator-polynomials for different frame formats.
The first polynomial, CRC_15, is used for all frames in CAN format. The second, CRC_17, is used
for frames in CAN FD format with a DATA FIELD up to sixteen byte long. The third, CRC_21, is
used for frames in CAN FD format with a DATA FIELD longer than sixteen byte.
13. What are the bits or fields to be considered for CRC calculation?
The relevant bit stream for CRC calculation is the bit stream consisting of START OF FRAME,
ARBITRATION FIELD, CONTROL FIELD, and (if present) DATA FIELD, supplemented with nCRC bits
of ’0’. In CAN FD format frames, STUFF-BITS are included in the relevant bit stream for CRC
calculation, in CAN format frames, STUFF-BITS are not included.
14. How is the CRC delimiter different from CAN and CAN-FD formats?
The CRC SEQUENCE is followed by the CRC DELIMITER. In CAN format, the CRC DELIMITER
is one single recessive bit. In CAN FD format, the CRC DELIMITER may consist of one or two
recessive bits. A Transmitter shall send only one recessive bit as CRC DELIMITER, but it shall
accept two recessive bits before the edge from recessive to dominant that starts the
ACKNOWLEDGE SLOT. A Receiver will send its ACKNOWLEDGE bit after the first
CRC DELIMITER bit.
15. Distinguish between ACK field in CAN and CAN-FD.
The ACK FIELD contains the ACK SLOT and the ACK DELIMITER. In the ACK FIELD, the transmitting
station sends recessive bits. A Receiver which has received a valid message correctly, reports this
to the Transmitter by sending one dominant bit at the start of the ACK SLOT.
All stations having received the matching CRC SEQUENCE report this within the ACK SLOT by
superscribing the recessive bit of the Transmitter with one dominant bit (they send ACK). In CAN
FD format, all nodes shall accept a two bit long dominant phase of overlapping ACK bits as a
valid ACK, to compensate for phase shifts between the Receivers. In CAN format, a dominant bit
following the single ACK SLOT bit is a FORM-ERROR. The recessive ACK DELIMITER is the last bit
of the ACK FIELD. As a consequence, the ACK SLOT is surrounded by two recessive bits (CRC
DELIMITER, ACK DELIMITER).
16. How is End of frame recognized in CAN formats?
Each DATA FRAME and REMOTE FRAME is delimited by a flag sequence consisting of
seven recessive bits.
19. Elaborate on active and passive error flags and error delimiter.
There are two forms of an ERROR FLAG: an ACTIVE ERROR FLAG and a PASSIVE ERROR
FLAG.
1. The ACTIVE ERROR FLAG consists of six consecutive dominant bits.
2. The PASSIVE ERROR FLAG consists of six consecutive recessive bits unless it is
overwritten by dominant bits from other nodes.
An error active station detecting an error condition signals this by transmission of an
ACTIVE ERROR FLAG. The ERROR FLAG’S form violates the law of bit stuffing applied to all fields from
START OF FRAME to CRC DELIMITER or destroys the fixed form ACK FIELD or END OF FRAME FIELD.
As a consequence, all other stations detect an error condition and on their part start transmission of
an ERROR FLAG. So the sequence of dominant bits which actually can be monitored on the bus
results from a superposition of different ERROR FLAGS transmitted by individual stations. The total
length of this sequence varies between a minimum of six and a maximum of twelve bits. An error
passive station detecting an error condition tries to signal this by transmission of a PASSIVE ERROR
FLAG. The error passive station waits for six consecutive bits of equal polarity, beginning at the start
of the PASSIVE ERROR FLAG. The PASSIVE ERROR FLAG is complete when these 6 equal bits have
been detected.
The ERROR DELIMITER consists of eight recessive bits. After transmission of an ERROR FLAG each
station sends recessive bits and monitors the bus until it detects a recessive bit. Afterwards it starts
transmitting seven more recessive bits.
20. What are the features of an Overload frame?
The OVERLOAD FRAME contains the two bit fields OVERLOAD FLAG and OVERLOAD DELIMITER.
There are three kinds of OVERLOAD conditions, which lead to the transmission of an
OVERLOAD FLAG:
1. The internal conditions of a Receiver, which requires a delay of the next DATA FRAME
or REMOTE FRAME.
2. Detection of a dominant bit at the first or second bit of INTERMISSION.
3. If a CAN FD node samples a dominant bit at the eighth bit (the last bit) of an ERROR
DELIMITER or OVERLOAD DELIMITER, or if a CAN FD Receiver samples a dominant bit
at the last bit of END OF FRAME, it will start transmitting an OVERLOAD FRAME (not an
ERROR FRAME). The Error Counters will not be incremented.
The start of an OVERLOAD FRAME due to OVERLOAD condition 1 is only allowed to be
started at the first bit time of an expected INTERMISSION, whereas OVERLOAD FRAMES
due to OVERLOAD condition 2 or condition 3 start one bit after detecting the dominant bit. The
overload flag consists of six dominant bits. The overload delimiter consists of eight recessive
bits.
21. Calculate the bit timing segments for a 250Kbps CAN transmission if the controller frequency is
8MHz.
Bit timing rules and calculations are as follows:
Fosc = 8MHz
Bit Time = 1/Bit rate = 1/250kbps = 1/250,000 = 4 microseconds = 4us.
Choose Baud rate Prescaler =1, then Time quanta Tq = 2*BRP/Fosc = 2x1/8000000 = 0.25us
Rules for the four segments are as follows:
Sync segment SJW = 1Tq
PropSeg = 1 to 8Tq
PS1 = 1 to 8Tq
PS2 = 2 to 8Tq
PS2 > SJW
PropSeg + PS1 >= PS2
1. PAM3 coding is used to generate voltage waveforms in the PHY layer based on the bit pattern of
the data stream. Decipher the waveforms derived showing the conversion of the following
datastream through the various steps for the following data: 0x05 0x39 0x77
2. Given the voltages in each bit time find the data appearing in the payload for the following
stream of voltage measured:
a) -1 -1 -1 0 -1 1 0 -1 0 1 1 -1 1 0 1 1
b) 1 1 0 1 -1 1 1 0 -1 0 1 -1 0 -1 -1 -1
3. Compare ECU interface with microcontroller unit for 100BASE T1
4. Describe the Ethernet frame with the significant fields used to carry payload data from one node
to another
5. Describe the function of an Ethernet switch and how it is deployed to be trained to route data
from one node to another. Explain with an example of how the Cluster ECU gets data from ABS
ECU and Brake ECU gets data from TPMS ECU
6. Compare the headers of UDP and TCP-IP and how they are suitable for automotive Ethernet
applications.
7. Show the features of CCP protocol implemented in a complete CAN frame.
8. Show the data exchange in a CCP protocol used for calibration.
To change a parameter in an XCP slave, the XCP master must send both the address where the parameter is
located and the value itself to the slave. XCP always defines addresses with five bytes: four for the actual address
and one byte for the address extension. Based on a CAN transmission, only seven
useful bytes are available for XCP contents. If, for example, you change a 4-byte value and want to send both
pieces of information in one CAN frame, the number of bytes is not sufficient. Since a total of nine bytes are
required for the transmission of the address and the new value, the change cannot be
transmitted in one CAN frame (seven user bytes). The change request is therefore made with two packets from the
master to the slave. The slave must acknowledge both packets, in total four packets are exchanged. The following
figure shows the communication between master and slave necessary for setting a parameter value. In the line
with the envelope symbol the data content of the packet is shown.
In the first packet the master transmits the command SET_MTA with the
address (HEX: 001C002C, Extension: 0), to which a new value is to be written,to the slave.
With the second packet the slave confirms the command positively with Ok:SET_MTA.
The third packet DOWNLOAD transmits the hex value (00 00 E0 40) and additionally the valid number of
bytes. In this example the valid number of bytes is four, because it is a float value.
The slave confirms positive again with the fourth packet.
This completes the actual calibration process. In the trace display you can see a subsequent SHORT_UPLOAD in the
trace display - a special feature of CANape, Vector's measurement and calibration tool. To make sure that the
calibration has worked, the value is read out again after the process and the display in CANape is updated with the
read-out value. In this way, the user can
see directly whether his calibration command has been successfully processed.
This command is also confirmed positively with Ok:SHORT_UPLOAD.
A MAC (Media Access Control) address is a hardware identification number that uniquely identifies each device on
a network. The MAC address is used to determine where packets will be sent on a network.
Switches are used to connect multiple devices on an Ethernet network. They channel incoming data from any of
the multiple input ports to the specific output port that will take the data toward its intended destination. This
allows for simultaneous communication across the network, improving efficiency.
FCS is a type of checksum algorithm used to detect errors in data transmission. It ensures that the data received at
the destination are exactly the same as they were at the source.
13. Compare ipv4 and ipv6 addressing in Ethernet protocols.
Each IP packet is composed of an IP header and the payload. The payload is the actual data we want to transmit,
such as part of an email, or part of an image from a web page. The following is an illustration of an IP packet and its
components.
Ipv4 header
The fields titled Source address and Destination address contain the addresses that correspond to the IPv4
address of the host sending the packet and the intended recipient of the packet.
IPv4 addresses are composed of 32-bit binary numbers. An example of an IPv4 address is as follows:
11000000101010000000000100000001
192.168.1.1
iPV6 packet
2001:ABCD:0000:0000:0000:0000:0000:0001
The use of extension headers – The IPv6 header is modular, and you can append additional headers
based on what features are needed. Extension headers are used for things like inherent security, packet
flow (QoS), and mobility to name a few.
Application layer. The application layer is where data originates on the sender’s side. Applications are used to
create the data. A web browser, for example, is used to generate the data that gets sent through the rest of the
layers, assisted by the Domain Name System (DNS), which associates web domain names with their Internet
Protocol (IP) addresses.
Transport layer. In the transport layer, the data gets encoded so it can be transported through the internet using
either the User Datagram Protocol (UDP) or TCP.
Network access layer. In the network access layer, the data gets a header and a trailer, and these tell the data
where to go. This information is then conveyed to the network interface layer.
Network interface layer. At the network interface layer, the packet of data gets formatted and prepared to be
transported and routed through the network.
Hardware layer. On the hardware layer, the data is turned into something that can be sent to and read by a
computer or other device. For example, the IEEE 802.3 protocol is used to convert data into what is used in
an Ethernet connection.
TCP handles data transmission and IP handles addresses. The TCP/IP protocol suite has a set of protocols that
includes
TCP
UDP
ARP
DNS
HTTP
ICMP, etc.
15. What are the various layers in the OSI model?
16. How does a UDP packet look like when we mention UDP over IP?
The first four bytes of the UDP header store the port numbers for the source and destination.
A networked device can receive messages on different virtual ports. The different ports help distinguish
different types of network traffic.
Each row starts with the name of the process that's using the port and ends with the protocol and port
number.
Segment Length
The next two bytes of the UDP header store the length (in bytes) of the segment (including the header).
Two bytes is \[16\] bits, so the length can be as high as this binary number:
\[1111111111111111\]
In decimal, that's \[(2^{16}-1)\] or \[65{,}535\]. Thus, the maximum length of a UDP segment is \[65{,}535\] bytes.
Checksum
The final two bytes of the UDP header is the checksum, a field that's used by the sender and receiver to check for
data corruption.
Before sending off the segment, the sender:
1. Computes the checksum based on the data in the segment.
2. Stores the computed checksum in the field.
Upon receiving the segment, the recipient:
1. Computes the checksum based on the received segment.
2. Compares the checksums to each other. If the checksums aren't equal, it knows the data was corrupted.
o Source port: It defines the port of the application, which is sending the data. So, this field contains the
source port address, which is 16 bits.
o Destination port: It defines the port of the application on the receiving side. So, this field contains the
destination port address, which is 16 bits.
o Sequence number: This field contains the sequence number of data bytes in a particular session.
o Acknowledgment number: When the ACK flag is set, then this contains the next sequence number of the
data byte and works as an acknowledgment for the previous data received. For example, if the receiver
receives the segment number 'x', then it responds 'x+1' as an acknowledgment number.
o HLEN: It specifies the length of the header indicated by the 4-byte words in the header. The size of the
header lies between 20 and 60 bytes. Therefore, the value of this field would lie between 5 and 15.
o Reserved: It is a 4-bit field reserved for future use, and by default, all are set to zero.
o Flags
There are six control bits or flags:
o URG: It represents an urgent pointer. If it is set, then the data is processed urgently.
o ACK: If the ACK is set to 0, then it means that the data packet does not contain an
acknowledgment.
o PSH: If this field is set, then it requests the receiving device to push the data to the receiving
application without buffering it.
o RST: If it is set, then it requests to restart a connection.
o SYN: It is used to establish a connection between the hosts.
o FIN: It is used to release a connection, and no further data exchange will happen.
o Window size
It is a 16-bit field. It contains the size of data that the receiver can accept. This field is used for the flow
control between the sender and receiver and also determines the amount of buffer allocated by the
receiver for a segment. The value of this field is determined by the receiver.
o Checksum
It is a 16-bit field. This field is optional in UDP, but in the case of TCP/IP, this field is mandatory.
o Urgent pointer
It is a pointer that points to the urgent data byte if the URG flag is set to 1. It defines a value that will be
added to the sequence number to get the sequence number of the last urgent byte.
o Options
It provides additional options. The optional field is represented in 32-bits. If this field contains the data
less than 32-bit, then padding is required to obtain the remaining bits.
FAQ-Flexray
1. What is Flexray communication?
FlexRay is a cutting-edge communication protocol developed to meet the demanding
requirements of advanced automotive systems. It offers high-speed and deterministic
communication, making it ideal for applications that require real-time data transfer, such
as drive-by-wire systems.
2. How many channels are there in Flexray communication?
The FlexRay bus consists of a pair of communication channels, referred to as channel A
and channel B, which operate in a dual-redundant mode. Each channel is a twisted pair
cable employing differential signaling and NRZ encoding. These channels allow for fault
tolerance, as if one channel fails, the system can seamlessly switch to the other. The
channels are connected to the bus nodes, which can be electronic control units (ECUs)
or sensors. The bus nodes communicate with each other by transmitting and receiving
messages over the FlexRay bus.
3. What is the bus access method used by Flexray?
To support both deterministic transmission and event-based communication, the
FlexRay protocol employs two mechanisms - Time Division Multiple Access (TDMA)
and Flexible Time Division Multiple Access (FTDMA).
The TDMA method defines a communication schedule or cycle which is split into time
slots. Each node in the bus has one or more slots assigned in which it is granted access
to the bus. This communication schedule is repeated periodically by all nodes in quick
succession thereby providing a deterministic communication.
The FTDMA method is used to implement a dynamic segment which reserves a specific
slot in the communication cycle that can be used by any node to transmit messages in a
non-deterministic manner on a need basis.
4. Describe a typical FlexRay Communication Cycle.
The FlexRay communication cycle is the core aspect of the protocol. It consists of a
static segment, a dynamic segment, a symbol window, and a Network Idle Time (NIT).
Of these, the static segment and NIT are always present and the other two are optional.
The static segment is deterministic and provides a fixed time slot for high-priority
messages. The dynamic segment allows for flexible scheduling of lower priority
messages. The symbol window defines the time period for transmitting and receiving
data. During each communication cycle, the bus nodes exchange messages in a
predefined sequence, ensuring timely and reliable communication.
5. How is FlexRay Clock and Timing designed?
The FlexRay clock plays a crucial role in synchronizing the communication between bus
nodes. It provides a reference for timing events and ensures that all nodes operate in a
coordinated manner. The timing hierarchy in FlexRay consists of macroticks and
microticks. A macrotick is divided into a fixed number of microticks, which allows for
fine-grained timing control. The duration of a macrotick depends on the configuration of
the FlexRay system, and the number of microticks determines the resolution of the
protocol. It is established using a cluster-wide clock synchronization process. The
microticks are more granular and are derived from the local oscillator at the node level.
By carefully configuring the macroticks and microticks, the system can achieve the
desired timing requirements. The timing hierarchy allows for precise and deterministic
communication, ensuring that messages are transmitted and received at the correct
time.
6. Describe the FlexRay Static Segment and Static Slot.
The static segment in FlexRay provides a deterministic time slot for high-priority
messages. It is divided into static slots, which are allocated to specific bus nodes based
on their priority. A maximum of 1023 static slots can be defined on each channel per
segment. The length of a static slot is determined by the longest FlexRay message,
largest transmission delay (up to 2,5 µs) and the clock skew between nodes. Each static
slot consists of four segments: Action Point Offset, FlexRay Frame, Channel Idle
Delimiter (11 recessive bits) and Channel Idle. During the static segment, each bus
node is guaranteed a fixed amount of time to transmit its message. Having no collision
or delay, this deterministic allocation ensures that high-priority messages are
transmitted without delay, enabling real-time communication in critical applications.
12. Provide a design for 25ns microtick for a Flexray quartz clock of 20MHz with a 4x
PLL. How should we design the divider for the microtick.
For a 20MHz clock with 4x PLL the clock frequency is 80MHz and the clock period is
0.0125us = 12.ns To get a 25ns cycle time we need to employ a clock divider of 2 for the
80MHz clock so that the clock period comes down to 40MHz and microtick period comes
to 1/40MHz = 25ns
13. Describe the Header, payload and trailer in a typical Flexray Node transmission in the
static slot describing the various fields.
16. Describe the voltage values for the logic transmission of a single bit in the
Flexray PHY layer terminals BP+ and BP-.
a) Idle_LP : -200 mV and 200 mV is present at BP and BM to indicate start of
transmission
b) Idle: 2.5V on BP and BM with a 500mV tolerance
c) Data_0: one transmitting node must apply a negative differential voltage of -
600 mV to the channel
d)Data_1: one transmitting node must apply a positive differential voltage of 600
mV to the channel
17. Describe NRZ type of logic data transmission with an example.
NRZ (non-return-to-zero) refers to a form of digital data transmission in which the
binary low and high states, represented by numerals 0 and 1, are transmitted by
specific and constant DC(direct-current) voltages.
In positive-logic NRZ, the low state is represented by the more negative or less
positive voltage , and the high state is represented by the less negative or more
positive voltage. Examples are:
Logic 0 = +0.5 volts
Logic 1 = +5.0 volts
Logic 0 = -3.0 volts
Logic 1 = 0.0 volts
In negative-logic NRZ, the low state is represented by the more positive or less
negative voltage, and the high state is represented by the less positive or more
negative voltage. Examples are:
Logic 0 = +5.0 volts
Logic 1 = +0.5 volts
Logic 0 = 0.0 volts
Logic 1 = -3.0 volts
MOST – FAQ- PHY
1. What is the physical transmission layer for MOST signals?
The physical layer for MOST transmission signals are made of polymer optical fibers
made of polymethyl methacrylate with 1mm diameter.
2. What are the transmitters and receiver components?
The transmitter is made of LED in the red wavelength range and the receiver is made of
silicon photo diode.
3. What is the datarate of MOST25?
The datarate is 22.6Mbits/sec or close to 25MBits/sec
4. What is the data rate for MOST 150?
The datarate is 147.5Mbit/sec or close to 150MBits/sec
5. What are the specification points for the physical layer and what do they cover?
SP1 and SP4 cover the specifications of the MOST Network Interface Controller and a
converter (electrical signals, electrical ramp response, connection timeout and jitter
response); SP2 and SP3 cover the wavelength, optical power, optical rise and fall times
and the mechanical dimensions of the MOST plugs.
6. What are the main advantages of using POF as the physical layer?
There are no EMC issue since electrical signals do not interfere with the optical medium.
Also the weight of the optical fibers are extremely low compared to twisted pair Copper
lines which are used in other networks such as CAN.
7. Describe the mechanism of how light is transmitted in an optical fiber core.
Optical fiber is used as the medium of conduction. The optical fiber is surrounded by an
optical cladding of low refractive index. A light ray incident on the acceptance cone uses
a zig-zag path inside the optical fiber medium to reach the other end.
8. How is the acceptance angle ψa related to numerical aperture NA?
NA = sin (ψa) =
With increasing length the optical pulse gets distorted in the optical fiber.
10. What is the relationship between the pulse widening effect with length?
Here L is the length of the optical cable and co is the speed of light. ZThe pulse distortion
limits the maximum bit rate of the wave guide. Maximum bit rate = 1/ΔΤ
For a standard polymer cable, with ncore = 1.49 and ncladding= 1.40 and L = 1m, Pulse
distortion = 320ps. For a in vehicle connection of 20m this works out to 150Mbit/sec.
11. Describe the transmitting device characteristics in optical transmission.
LEDs in the red wavelength of 650nm are used for the data transmission. Application of
voltage in the forward direction releases photons. The external efficiency is enhanced by
structural packaging and reflectors built in to the package. With a 10-40mA current
consumption, the optical power is between 0.1mW and 1mW. Power is expressed in
logarithmic units by the following equation:
Optical power of 1mW is 0dBm and that for 0.5mW is -3dBm which is less by 3dB.
About 100MHz bandwidth can be obtained with such a transmitter.
12. Explain the receiver characteristics in the physical layer for optical transmission.
PIN photodiodes have a thicker intrinsic depletion layer between the P and N junctions.
Silicon PIN diodes in the 650nm range are used as receivers.
Both transmitter and receiver have power supply pins - Vcc (3.3V) and GND
Differential data inputs TX+ and TX-, receiver differential signals RX+ and RX-, Reset pin
at the transmitter allows switching the inputs ON and OFF. Status pin on receiver is used
to alert the receiver side for data availability.
The SMD equivalent package presently used that can handle data in Gigabit speed range
appear as follows.
14. Relate the frame rate and timing for the MOST channel.
The data rate for MOST150 results from the product of frame size of and the frame 3072
bits per frame and the frame rate Fs. At 48KHz sampling rate, the required bit rate is
147.56 Mbits/sec The pulse length is half bit transfer time.
At BPF = 3072 and Fs = 48KHz, the unit interval comes to 3.391ns. Five different symbol
lengths comprising of 2,3,4,5,6 UI are used. The possible pulse lengths are shown.
MOST50 uses 50Mbit/sec as the datarate with a frame length of 1024bits or 128 bytes. The
sample rate is the same as a result in comparison to MOST25. The control data is placed in 4
bytes of the 11 byte header. The boundary descriptor and the System Lock flaf are also present
in the 11 byte header. Without the need for resynchronization as in the MOST25 frame, the
bandwidth of the stream packet and the packet data can be changed dynamically. The property
Netblock.Boundary determines the split in the frame. The stream data can have a width of 0 to
29 quadlets plus 1 byte = 117 bytes. Packet data can be from 0 to 29 quadlets = 116 bytes.
Byte 8 transports the following message types according to the following format:
Normal Message: A normal message contains data packets of the control message
service. It transports the data for modifying properties and starting functions of a
function block as well as the resulting response message. A CD player can controlled
by a function block for example. The actual data is transported in 17 data bytes. The
normal message can be sent to one receiver (unicast), to a defined group of
receivers (group cast) and to all nodes (broadcast).
Local Interconnect Network – Frequently Asked Questions
1. Describe the features of a LIN bus
The LIN is a serial communications protocol which efficiently supports the control of
mechatronics nodes in distributed automotive applications.
The main properties of the LIN bus are:
•single master with multiple slaves concept
•low cost silicon implementation based on common UART/SCI interface hardware, an
equivalent in software or as pure state machine.
•self synchronization without a quartz or ceramics resonator in the slave nodes
•deterministic signal transmission with signal propagation time computable in advance
•low cost single-wire implementation
•speed up to 20 kbit/s.
•signal based application interaction
•predictable behavior
•reconfigurability
•transport layer and diagnostic support
The slave nodes are connected to the master node forming a LIN cluster. The corresponding
node capability files are parsed by the LIN cluster design tool to generate a LIN description
file (LDF) in the LIN cluster design process. The LDF is parsed by the LIN cluster generator to
automatically generate LIN related functions in the desired nodes (the Master node and
Slave3 node in the example shown in the picture above). The LDF is also used by a LIN bus
analyzer/emulator tool to allow for cluster debugging.
3. From an Application - API software structure point of view how is a node featured in
LIN bus?
The workflow generates the complete LIN cluster interaction module and the developer only has
to supply the application performing the logic function of a node.
A node in a cluster interfaces to the physical bus wire using a frame transceiver. The frames are
not accessed directly by the application; a signal based interaction layer is added in between. As
a complement, a transport layer interface exists between the application and the frame handler,
as depicted below.
4. Show how one Master and two slaves are featured in a LIN bus.
A cluster consists of one master task and several slave tasks. A master node contains the master
task as well as a slave task. All other slave nodes contain a slave task only. A node may
participate in more than one cluster. The term node relates to a single bus interface of a node if
the node has multiple bus interfaces. The master task decides when and which frame shall be
transferred on the bus. The slave tasks provide the data transported by each frame.
5. What is a schedule table?
The master task (in the master node) transmits headers based on a schedule table. The schedule
table specifies the frames and the interval between the start of a frame and the start of the
following frame. The master application may use different schedule tables and select among
them.
6. What are the various Signal types and their properties in LIN protocol?
A signal is transported in the data field of a frame. A signal is either a scalar value or a byte
array. A scalar signal is between 1 and 16 bits long. A one bit scalar signal is called a boolean
signal. Scalar signals in the size of 2 to 16 bits are treated as unsigned integers. A byte array is an
array of between one and eight bytes. Each signal has exactly one publisher, i.e. it is always
written by the same node in the cluster. Zero, one or multiple nodes may subscribe to the signal.
All signals have initial values. The initial value for a published signal is valid until the node writes
a new value to this signal. The initial value for a subscribed signal is valid until a new updated
value is received from another node.
7. How are signals packed in a frame?
A signal is transmitted with the LSB first and the MSB last. There is no restriction on packing
scalar signals over byte boundaries. Each byte in a byte array shall map to a single frame byte
starting with the lowest numbered data byte. Several signals can be packed into one frame as
long as they do not overlap each other. Note that signal packing/unpacking is implemented
more efficient in software based nodes if signals are byte aligned and/or if they do not cross
byte boundaries. The same signal can be packed into multiple frames as long as the publisher of
the signal is the same. If a node is receiving one signal packed into multiple frames the latest
received signal value is valid.
8. Describe the structure of a frame in LIN protocol with a suitable diagram.
Break field: The break field is used to signal the beginning of a new frame. A break field is
always generated by the master task (in the master node) and it shall be at least 13 nominal bit
times of dominant value, followed by a break delimiter.
Synch field: Sync is a byte field with the data value 0x55 (In binary 01010101). When a
break/sync field sequence happens, the transfer in progress shall be aborted and
processing of the new frame shall commence.
Protected Identifier Field: A protected identifier field consists of two sub-fields; the frame
identifier and the parity. Bits 0 to 5 are the frame identifier and bits 6 and 7 are the parity.
Frame Identifier: Six bits are reserved for the frame identifier, values in the range 0 to 63 can be
used. The frame identifiers are split in three categories:
•Values 0 to 59 (0x3B) are used for signal carrying frames,
•60 (0x3C) and 61 (0x3D) are used to carry diagnostic and configuration data,
•62 (0x3E) and 63 (0x3F) are reserved for future protocol enhancements.
Parity: The parity is calculated on the frame identifier bits as shown in equations (1) and (2):
P0 = ID0 ⊕ ID1 ⊕ ID2 ⊕ ID4 (1)
P1 = -(ID1 ⊕ ID3 ⊕ ID4 ⊕ ID5) (2)
( ⊕ is EXOR operator )
Order of bits in Frame identifier
Data bytes
A frame carries between one and eight bytes of data. The number of data contained in a frame
with a specific frame identifier shall be agreed by the publisher and all subscribers. A data byte is
transmitted as part of a byte field. For data entities longer than one byte, the entity LSB is
contained in the byte sent first and the entity MSB in the byte sent last (little-endian). The data
fields are labeled data 1, data 2,... up to maximum data 8.
Checksum:
The last field of a frame is the checksum. The checksum contains the inverted eight bit sum with carry
over all data bytes or all data bytes and the protected identifier. Checksum calculation over the data
bytes only is called classic checksum and it is used for the master request frame, slave response frame
and communication with LIN 1.x slaves. Eight bit sum with carry is equivalent to sum all values and
subtract 255 every time the sum is greater or equal to 256.
Checksum calculation over the data bytes and the protected identifier byte is called enhanced checksum
and it is used for communication with LIN 2.x slaves. The checksum is transmitted in a byte field.
Use of classic or enhanced checksum is managed by the master node and it is determined per frame
identifier; classic in communication with LIN 1.x slave nodes and enhanced in communication with LIN
2.x slave nodes.
Frame identifiers 60 (0x3C) to 61 (0x3D) shall always use classic checksum.
9. Show the steps involved in calculating checksum for the data bytes 0x4A, 0x55, 0x93, 0xE5
The hex data bytes in binary are as follows. Here is one method to calculate the checksum.
0x4a = 0100 1010
0x55 = 0101 0101
0x93 = 1001 0011
0xE5 = 1110 0101
Step1: Add the first two numbers. If there is a Carry generated add that to the number to get
Result1.
0100 1010 +
0101 0101
---------------
1001 1111 Result1 = 0x9F
Step2: Add the Result1 to next number 0x93
1001 1111 +
1001 0011
--------------
1 00110010 = 0x32 with a Carry of 1
Add the carry to the number 0x32 to get Result 2
0011 0010 +
1
----------------
0011 0011 Result2 is 0x33
Step3: Add Result2 to last data byte 0xE5
0011 0011 +
1110 0101
--------------
1 0001 1000 The result is 0x18 with a Carry of 1
Add the Carry to the number to get Result3
0001 1000 +
1
--------------
0001 1001 Result3 is 0x19
Now take the complement of the number to get Checksum byte
Checksum = 1110 0110 = 0xE6
10. Can Collision occur in LIN protocol. Discuss with an example how two slave nodes may
respond to the same Frame identifier.
A schedule table contains only one event-triggered frame (ID=0x10). The event-triggered frame
is associated with two unconditional frames from slave 1 (ID=0x11) and slave 2 (ID=0x12). The
collision resolving schedule table contains the two unconditional frames.
A typical use for the event triggered frame is to monitor the door knobs in a four door central
locking system. By using an event triggered frame to poll all four doors the system shows good
response times, while still minimizing the bus load. In the rare occasion that multiple passengers
press a knob each, the system will not lose any of the pushes, but it will take some additional
time.
11. Describe the wakeup process in LIN signals.
Any node in a sleeping LIN cluster may request a wake up, by transmitting a wake up signal. The
wake up signal is started by forcing the bus to the dominant state for 250 μs to 5 ms, and is valid
with the return of the bus signal to the recessive state. The master node may issue a break field,
e.g. by issuing an ordinary header since the break will act as a wake up signal (in this case the
master must be aware of that this frame may not be processed by the slave nodes since they
may not yet awake and ready to listen to headers).Every slave node (connected to power)
should detect the wake up signal (a dominant pulse longer than 150 μs followed by a rising edge
of the bus signal) and be ready to listen to bus commands within 100 ms, measured from the
ending edge of the dominant pulse. A detection threshold of 150 μs combined with a 250 μs
pulse generation gives a detection margin that is enough for uncalibrated slave nodes. If the
node that transmitted the wake up signal is a slave node, it will be ready to receive or transmit
frames immediately. The master node shall also wake up and, when the slave nodes are ready,
start transmitting headers to find out the cause (using signals) of the wake up.
If the master node does not transmit a break field (i.e. starts to transmit a frame) or if the node
issuing the wake up signal does not receive a wake up signal (from another node) within 150 ms
to 250 ms from the wake up signal, the node issuing the wake up signal shall transmit a new
wake up signal. In case the slave node transmits a wake up signal in the same time as the master
node transmits a break field, the slave shall receive and recognize this break field.
13. Draw the block diagram of a master with three slaves response in a frame structure.
14. Verify the parity bits for this table.
C-sample code:
uint8_t checksum_calc (uint8_t ProtectedId, uint8_t * pdata, uint8_t len, uint8_t mode)
{
uint16_t tmp; //tmp is a 16 bit variable
uint8_t i; //I is a 8 bit variable
if (mode == CLASSIC) tmp = 0; //For Classic checksum load tmp = 0
else tmp = ProtectedId; //For Enhanced checksum load tmp = ProtectedID
for (i = 0; i < len; i++) //Compute for I = 0 to len-1
{
tmp += *pdata++; //Add to variable tmp databytes one at a time
if (tmp >= 256) tmp -= 255; //If tmp exceeds 255 then subtract 255
}
return ~tmp & 0xff; } //return the inverted least significant byte of tmp
FAQ_Wireless – Bluetooth & Zigbee
Every single Bluetooth device has a unique 48-bit address, commonly abbreviated BD_ADDR. This will
usually be presented in the form of a 12-digit hexadecimal value. The most-significant half (24 bits) of
the address is an organization unique identifier (OUI), which identifies the manufacturer. The lower 24-
bits are the more unique part of the address.
This address should be visible on most Bluetooth devices. For example, on this RN-42 Bluetooth Module,
the address printed next to "MAC NO." is 000666422152:
The "000666" portion of that address is the OUI of Roving Networks, the manufacturer of the module.
Every RN module will share those upper 24-bits. The "422152" portion of the module is the more unique
ID of the device.
Bluetooth devices can also have user-friendly names given to them. These are usually presented to the
user, in place of the address, to help identify which device it is.
The rules for device names are less stringent. They can be up to 248 bytes long, and two devices can
share the same name. Sometimes the unique digits of the address might be included in the name to
help differentiate devices.
Creating a Bluetooth connection between two devices is a multi-step process involving three progressive
states:
1. Inquiry -- If two Bluetooth devices know absolutely nothing about each other, one must run an
inquiry to try to discover the other. One device sends out the inquiry request, and any device
listening for such a request will respond with its address, and possibly its name and other
information.
2. Paging (Connecting) -- Paging is the process of forming a connection between two Bluetooth
devices. Before this connection can be initiated, each device needs to know the address of the
other (found in the inquiry process).
3. Connection -- After a device has completed the paging process, it enters the connection state.
While connected, a device can either be actively participating or it can be put into a low power
sleep mode.
o Active Mode -- This is the regular connected mode, where the device is actively
transmitting or receiving data.
o Sniff Mode -- This is a power-saving mode, where the device is less active. It'll sleep and
only listen for transmissions at a set interval (e.g. every 100ms).
o Hold Mode -- Hold mode is a temporary, power-saving mode where a device sleeps for
a defined period and then returns back to active mode when that interval has passed.
The master can command a slave device to hold.
o Park Mode -- Park is the deepest of sleep modes. A master can command a slave to
"park", and that slave will become inactive until the master tells it to wake back up.
The transmit power, and therefore range, of a Bluetooth module is defined by its power class. There are
three defined classes of power:
Class Number Max Output Power (dBm) Max Output Power (mW) Max Range
Class 1 20 dBm 100 mW 100 m
Class 2 4 dBm 2.5 mW 10 m
Class 3 0 dBm 1 mW 10 cm
Some modules are only able to operate in one power class, while others can vary their transmit power.
If you're replacing a serial communication interface (like RS-232 or a UART) with Bluetooth, SPP is the
profile for you. SPP is great for sending bursts of data between two devices. It's is one of the more
fundamental Bluetooth profiles (Bluetooth's original purpose was to replace RS-232 cables after all).
Using SPP, each connected device can send and receive data just as if there were RX and TX lines
connected between them. Two Arduinos, for example, could converse with each other from across
rooms, instead of from across the desk.
8. What is the profile to connect keyboards and mouse?
HID – Human Interface Device is the go-to profile for Bluetooth-enabled user-input devices like mice,
keyboards, and joysticks. It's also used for a lot of modern video game controllers, like WiiMotes or PS3
controllers. Bluetooth's HID profile is actually a riff on the HID profile already defined for human input
USB devices. Just as SPP serves as a replacement for RS-232 cables, HID aims to replace USB cables (a
much taller task!).
9. While driving if we need to speak on the cellphone what is the profile used?
Hands-Free Profile (HFP) and Headset Profile (HSP)
HFP is used in the hands-free audio systems built into cars. It implements a few features on top of those
in HSP to allow for common phone interactions (accepting/rejecting calls, hanging up, etc.) to occur
while the phone remains in your pocket.
Most A2DP modules support a limited set of audio codecs. In the least they'll suport SBC (subband
codec), they may also support MPEG-1, MPEG-2, AAC, and ATRAC.
11. What is the profile used for remote control of an audio system such as fast forward, skip a song
etc?
A/V Remote Control Profile (AVRCP): The audio/video remote control profile (AVRCP) allows for
remote controlling of a Bluetooth device. It's usually implemented alongside A2DP to allow the
remote speaker to tell the audio-sending device to fast-forward, rewind, etc.
Bluetooth isn't the best choice for every wireless job out there, but it does excel at short-range cable-
replacement-type applications. It also boasts a typically more convenient connection process than its
competitors (ZigBee specifically).
ZigBee is often a good choice for monitoring networks -- like home automation projects. These networks
might have dozens of wireless nodes, which are only sparsely active and never have to send a lot of
data.
BLE combines the convenience of classic Bluetooth, and adds significantly lower power consumption. In
this way it can compete with Zigbee for battery life. BLE can't compete with ZigBee in terms of network
size, but for single device-to-device connectivity it's very comparable.
WiFi is probably the most familiar of these four wireless protocols. We're all pretty familiar with what
purpose it's best for: Internet(!). It's fast and flexbile, but also requires a lot of power. For broadband
Internet access it blows the other protocols out of the water.
14. What are the applications for Wireless technologies in vehicular network.
- Bluetooth communication is used for multimedia in vehicles to enable hands-free operation of mobile
unit by communicating to the microphone and speakers connected to the display cluster
-Tire pressure monitoring unit that reads the air pressure in each tire and communicates to the ECU
connected to the cluster for diagnostics such as low pressure or flat tires.
15.What is the node architecture for Tire pressure monitoring system in vehicles?
Direct TPMS sensor consists of the following main components
Sensor module is mounted to the valve stem inside the tire:
Battery
Pressure sensor;
microcontroller with Analog to Digital converter;
Radio frequency transmitter;
Radio receiver and ECU to process data and display to cluster
Voltage regulator for power supply to microcontroller, RF circuits
16. Justify the right choice for sensor networks if we need to get the congestion data to the vehicle?
Zigbee networks are a natural choice for sensor networks spread over an area.
They have the ability to read data and forward the data taking a hopping path to reach a long distance.
About 65,000 nodes can be in the same network. They have the following features:
A long battery life in each node
Ability to route the data in a mesh network
Secure network with ability to handle data collision
17. Compare Zigbee and Bluetooth networks and justify the usage of Bluetooth in media networks.
Data rate in Bluetooth has much higher rate of 1-2Mbps compared to a low data rate in Zigbee
Also the number of nodes in a Bluetooth piconet is restricted to 7 and this suits well for an in-vehicle
media network. Relative power consumption is higher but the devices are used in close range and hence
sufficient for vehicle networks