Warning: VPW is for GM models, PWM is for Ford, ISO 9141-2 is for Asian and European models.
Total information
The device in question is a microcontroller made using CMOS technology (CMOS).
Caution: The controller is not intended to be connected to the first generation on-board self-diagnosis systems (OBD I)!
The device acts as a simple scanner and is designed to read diagnostic codes and data from the OBD II system (engine speed, coolant and intake air temperature, load characteristics, air flow to the engine, etc.) within the scope of SAE J1979 standard via any type of bus (PWM, VPW and ISO 9141-2).
The main purpose
To connect to a computer, a 3-wire wire is sufficient, the connection to the diagnostic connector is carried out with a 6-wire wire. The supply voltage is supplied to the controller through the 16-pin OBD diagnostic connector. Schematic diagram of the controller is presented below.
Schematic diagram of the interface controller for a personal computer with an OBD II on-board self-diagnosis system
Recommendations for use
An unshielded cable, no longer than 1.2 m, can be used to connect the device to the car, which is of particular importance when using the PWM protocol. When using a longer cable, reduce the resistance of the resistors at the input of the device (R8 and R9 or R15). When using a shielded cable, the shield should be disabled to reduce capacitance.
The cable for connecting to the computer's serial port can also be unshielded. The device works stably with a cable length of up to 9 m. For significantly longer cable lengths, a more powerful RS 232 communicator should be used.
The topology of electrical connections is arbitrary. Use additional shunt capacitors for high humidity.
Free software (browser) for reading codes and data can be downloaded from manufacturers' websites, and is intended for use under DOS. Insignificant size of the software application in the variant «under DOS» allows you to put it on a DOS boot floppy and use it even on computers equipped with software that is incompatible with DOS. An optional condition is even the presence of a hard disk in the computer.
General principles of data exchange
Warning: Unless otherwise stated, all numbers are in hexadecimal format (hex).
The decimal format is indicated by the label dec.
Data exchange takes place over a three-wire serial connection, without the use of initialization exchange of service messages (handshaking). The device listens to the channel for messages, executes the received commands and transmits the results to the personal computer (PC), then immediately returns to listening mode. The data entering and leaving the controller are organized as a chain of consecutive bytes, the first of which is the control one. Typically, the control byte is a number from 0 to 15 dec (or 0-F hex), which describes the number of information bytes that follow. So, for example, a 3-byte command would look like this: 03 (control byte), 1st byte, 2nd byte, 3rd byte. A similar format is used both for incoming commands to poll the on-board self-diagnosis system, and for outgoing messages containing the requested information. It should be noted that only four low bits are used in the control byte - the high bits are reserved for some special commands and can be used by the PC when initializing the connection with the controller and negotiating the data transfer protocol, as well as the controller to control transmission errors. In particular, in the event of a transmission error, the controller sets the most significant bit (MSB) control byte per unit. On successful transmission, all four high-order bits are set to zero.
Warning: There are some exceptions to the rules for using the check byte.
Initialization of the controller and on-board self-diagnosis system
To start data exchange, the PC must establish a connection with the controller, then initialize the controller and the OBD II data channel.
Establishing a connection
After connecting the controller to the PC and the OBD diagnostic connector, it must be initialized in order to prevent «freezes», related to noise in the serial lines if they were connected before the controller was powered on. At the same time, a simple check of interface activity is performed. The one-byte signal 20 is sent first (hex), perceived by the controller as a command to establish a connection. In response, the controller instead of the control sends a single byte FF hex (255 dec) and enters the waiting mode for receiving data. The PC can now proceed to initialize the data link.
Warning: This is one of the few cases where the controller does not use the check byte.
Initialization
At this stage, the protocol is initialized, according to which data will be exchanged, and in the case of the ISO protocol, the on-board system is initialized. Data is exchanged using one of three protocols: VPW (General Motors), PWM (Ford) and ISO 9141-02 (Asian/European manufacturers).
Warning: There are many exceptions: for example, when polling some car models Mazda Ford's PWM protocol can be used. Thus, if you encounter transmission problems, you should first try to use some other protocol.
The protocol is selected by sending a combination consisting of the control byte 41 (hexadecimal) and the byte immediately following it that specifies the protocol type: 0 = VPW, 1 = PWM, 2 = ISO 9141. For example, command 41 (hex) 02 (hex) the ISO 9141 protocol is initialized.
In response, the controller sends a control byte and a status byte. Setting the MSB of the control byte indicates a problem, and the status byte following it will contain the corresponding information. Upon successful initialization, control byte 01 is sent (hex), indicating that a verification status byte follows. In the case of VPW and PWM protocols, the verification byte is a simple echo of the protocol select byte (0 or 1, respectively), when initializing the ISO 9141 protocol, this will be a digital key returned by the onboard OBD processor and determining which of the two slightly different protocol versions will be used.
Warning: The digital key is purely informational.
It should be noted that the initialization of the VPW and PWM protocols is much faster, since it only requires the transfer of the relevant information to the controller. On models that meet the ISO standard, initialization takes about 5 seconds, spent on the exchange of information between the controller and the onboard processor, produced at a speed of 5 baud. It should be noted to the reader that on some ISO 9141 family vehicles the protocol initialization is suspended if a data request is not sent within a 5 second interval - this means that the PC should automatically issue requests every few seconds, even at idle. mode.
After the connection is established and the protocol is initialized, regular data exchange begins, consisting of requests received from the PC and responses issued by the controller.
Data exchange procedure
Controller operation when using protocols of the ISO 9141-2 and SAE family (VPW and PWM) occurs under several different scenarios.
Exchange via SAE protocols (VPW and PWM)
When exchanging data using these protocols, only one data frame is buffered, which means that it is necessary to specify the frame to be captured or returned. In some (rare) cases, the onboard processor may transmit packets consisting of more than one frame. In such a situation, the request must be repeated until all frames of the packet have been received.
Request always formed as follows: [Control byte], [SAE request], [Frame number]. As mentioned above, the control byte is usually a number equal to the total number of bytes that follow it. The request is made in accordance with the SAE J1950 and J1979 Specifications and consists of a header (3 bytes), sequences of information bytes and error control byte (CRC). Note that while information on request is formed in strict accordance with the SAE Specifications, the consumer of the control byte and frame number is the interface chip.
Upon successful completion of the procedure, a response message always has the following format: [Check Byte], [SAE Standard Response]. The control byte, as before, determines the number of information bytes following it. The response, in accordance with the requirements of the SAE standard, consists of a header (3 bytes), strings of information bytes and a CRC byte.
On failure sent 2-byte response message: [Check Byte], [Status Byte]. In this case, the MSB is set in the control byte. The four least significant bits form the number 001, indicating that the control is followed by a single byte, the status byte. This situation can occur quite often, since the Specifications allow for the possibility of the on-board processor not issuing data, as well as the transmission of incorrect data in the case when the request does not meet the standard supported by the vehicle manufacturers. It is also possible that the requested data is not available in the processor's RAM at the current time. When the chip does not receive the expected response, or receives corrupted data, the MSB of the check byte is set, and the status byte is issued after the check.
For bus collisions, the interface generates a single byte 40 (hex), which is a control byte with the least significant bit set to zero. A similar situation can occur quite often when the car bus is loaded with messages of a higher priority than the diagnostic data - the computing device must repeat the original request.
Exchange according to ISO 9141-2 protocols
The ISO 9141-2 standard is used by most Asian and European automotive manufacturers. The structure of the generated PC request is not much different from that used in the SAE standards, with the only difference that the chip does not need information about the frame number and the corresponding information should not be present in the packet. Thus, request always consists of a check byte followed by a string of data bytes, including the checksum. As response message the chip simply relays the signals generated by the onboard processor. There is no check byte in the response message, so the PC accepts incoming information continuously until the chain is interrupted by a 55 millisecond pause indicating the completion of the information packet. Thus, a response message may consist of one or more frames as required by the SAE J1979 Specifications. The chip does not analyze frames, discard non-diagnostic frames, etc. The PC must process the incoming data on its own in order to isolate individual frames by analyzing the header bytes.
Warning: Most query responses consist of a single frame.
Modifications made in the latest interface controllers
Below are the main differences in the process of data transfer using the SAE and ISO 9141 protocols, which are specific to the latest versions of interface controllers, as well as the order of data transfer using the ISO 14230 protocol: 1. ISO 9141 standard: Added address byte;
2. ISO 9141: Not one, but both key bytes are returned; (extra byte is also returned in SAE modes, however it is not used here).
3. Added support for ISO 14230 protocol.
Warning: All data bytes are transmitted in hexadecimal format.
Warning: The character XX denotes an undefined, reserved, or unrecognized byte.
Establishing a connection
The connection setup order has not changed:
Shipping: | 20 |
Reception: | FF |
Protocol selection
VPW:
|
|
Shipping: |
41, 00 |
Reception: |
02, 01, XX |
PWM: |
|
Shipping: |
41, 01 |
Reception: |
02, 01, XX |
ISO 9141: |
|
Shipping: |
42, 02, adr, where: adr - address byte (usually 33 hex) |
Reception: |
02, K1, K2, where K1, K2 are ISO key bytes |
Or: |
82, XX, XX (ISO 9141 initialization error) |
ISO 14230 (fast initialization): |
|
Shipping: |
46, 03, R1, R2, R3, R4, R5, where: R1 ÷ R5 - message about the start of an ISO 14230 connection request, usually R1 ÷ R5 = C1, 33, F1, 81, 66 |
Reception: |
S1, S2, ……… - messages about the beginning of the ISO 14230 response to the connection |
Warning: More than one ECU can be transmitted in series. A negative response code can be used as a response.
A typical positive response looks like this: S1, S2, ……. = 83, F1, 10, C1, E9, 8F, BD
ISO 14230 (slow initialization): Similar to ISO 9141
Remark and comments
If you plan to use the controller to transfer data only through any one or two of the protocols, unnecessary components can be excluded (see diagram above). For example, when organizing a scheme for the VPW protocol (GM) only three wires of electrical wiring are required in the wire connecting the controller to the car (terminals 16, 5 and 2).
If the PWM protocol is not used, the elements R4, R6, R7, R8, R9, R10, T1, T2 and D1 may be excluded.
In case of refusal to exchange under the ISO protocol, the following elements are subject to exclusion: R15, R16, R17, R18, R19, R21, T4 and T5.
Rejection of the use of the VPW protocol allows you to exclude the following elements: R13, R14, R23, R24, D2, D3 and T3.
Carbon film resistors with 5% resistance tolerance are used.
Note the absence of an emergency reset button (RESET), if necessary, such a reboot can be done by disconnecting the controller from the car connector (the interface processor will restart automatically). Restarting the software on the PC results in a new interface initialization.
Visitor comments