PIC 16F..DataSheet
PIC 16F..DataSheet
07 OBD II Interface Chip Data Sheet For PWM, VPW, and ISO 9141-2 Vehicles
VPW (general motors), PWM (Ford products), and ISO 9141-2 (Asian/European)
If you are using a completed unit, you don't need to read this data sheet. This data sheet is intended for those who are building their own hardware using the BR16F84-1.07 Chip, or writing custom software to employ this device in a particular application.
GENERAL DESCRIPTION:
This device is a CMOS microcontroller which is designed to interface a personal computer or laptop with a vehicle's On Board Diagnostic (OBD II) interface. It is intended to function with all three of the protocols used by vehicle manufacturers to implement the OBD II system as defined by SAE and ISO specifications. The OBD II system became mandatory for 1996 and up vehicles, but some vehicles were already fully or partially compatible with OBD II requirements prior to 1996. The chip is not suitable for the earlier vehicles such as OBD I. The device is intended to function as a simple scan tool and is capable of sending and receiving any OBD II message defined in SAE J1979 for any of the three types of OBDII bus implementations (PWM, VPW, ISO 9141-2). It can also be used as an inexpensive interface for custom instrumentation monitoring various vehicle parameters such as speed, RPM, coolant or intake air temperature, engine load, intake air flow rate, etc.
FEATURES:
Operating Voltage Operating Current Clock: 20 MHz 5.0 V 5 Ma. Typ
Inputs: (0-5V levels) Serial Input (19200 Baud) PWM receive VPW receive ISO 9141-2 Outputs (0-5V levels) Serial output (19200 Baud) PWM transmit bus+ (inverted) PWM transmit bus- (inverted) VPW transmit ISO 9141-2 L line transmit (inverted) ISO 9141-2 K line transmit (inverted)
APPLICATION HINTS
(1) The cable to vehicle can be simple unshielded wires. This cable should be kept as short as possible, and definitely no longer than 4 feet, especially for PWM operation. Somewhat longer cables could be used if the circuit's termination resistors are replaced with lower values. (2) The cable to Computer serial port can also be unshielded. The application circuit has been tested with unshielded cables up to 30 Ft., but specific implementations may vary, so you may want to experiment if you are attempting long runs. For every long runs, you might also wish to use an RS 232 transceiver chip in your design. (3) Circuit layout is not critical. The circuit has been tested on both hard wired perfboard prototypes and plugboard breadboards. However, if your layout is very sloppy, you may want to add additional bypass capacitors. (4) Free software to utilize the application circuit is available for download. The program will run under DOS, so it can be used on older computers as well as newer machines running windows. It is small enough that it will fit on a DOS boot floppy, so you can still run it if your main operating system is not DOS compatible. The computer need not even have a hard drive.
PARTS LIST :
Value
.01 UF .1 UF .47 UF 20 pf 10 KOhm 18 KOhm 1 KOhm 5.6 KOhm 510 Ohm 62 KOhm 9.1 KOhm 270 Ohm 1N4739 1N4148 PN2222 PN3904 PN3906 7805 LM339N 16F84 20 MHz
Description
Capacitor, 25V " Capacitor, 50V " Resistor, 1/4 Watt " " " " " " Resistor, 1/2 Watt Not used Zener, 9.1V, 1W Diode Transistor, NPN Transistor, NPN Transistor, PNP Regulator, 5V Quad Comparator Microprocessor Crystal, 20 Mhz
Qty
2 1 1 2 9 1 8 1 2 1 1 1 1 1 2 3 1 1 1 1 1 1
Designators
C5, C6 C4 C3 C2,C1 R11, R12, R23, R9, R1, R3, R4, R25, R8 R24 R19, R18, R7, R20, R22, R5, R6, R13 R21 R16, R17 R10 R15 R14 R2 D2 D1, D3 Q3, Q4, Q5 Q2 Q1 IC2 IC3 IC1 XTL 1
Miscellaneous: Board, connectors, cable, wire, sockets, enclosure, etc, Depending on your implementation. NOTES: 1) All Resistors can be 5% Carbon Film types (Don't use wirewound types) 2) Capacitor voltage ratings can be higher than specified. 3) Capacitors can be ceramic or monolithic. 4) Microprocessor uses Ver 1.07 firmware 5) Transistor packages can be substituted. Example: 2N3904 for PN3904
(2) INITIALIZATION
This initializes the protocol to be used, and also initializes the vehicle in the case of ISO. There are three protocols, VPW (general motors), PWM (Ford products), and ISO 9141-2 (Asian/European). There are many exceptions to these general protocols, for example, some Mazda's use Ford's PWM protocol. So, if you have problems with a particular protocol, you should try another. The protocol selection is done by sending a control byte which is 41H, followed by a protocol select byte. The latter byte is defined as follows; 0=VPW, 1=PWM, 2=ISO 9141. For example, 41H 02H is the sequence to initialize to ISO 9141 protocol. The chip will respond with a control byte and a status byte. The control byte will have the MSB set if there was a problem, and in this case the next byte is a status byte which indicates internal conditions. If the initialization was a success, the control byte will be 01H, which indicates one verification status byte follows. This status byte is a verification byte and is defined as follows; For VPW or PWM, this byte is simply an echo of the protocol byte that you sent (0 or 1). For ISO 9141 it will be a "KEY number" that was returned from the vehicle itself and specifies one of two slightly different versions of ISO. It is for informational purposes only. Note that for VPW and PWM, the protocol select is rapid, because it is only needed to inform the chip which protocol is to be used. But, for ISO vehicles, it can take up to approximately 5 seconds, because there is a detailed initialization sequence that the chip must perform at 5 baud with the vehicle. Also NOTE that some legacy ISO 9141 vehicles will lose initialization if no data requests are made during a 5 second interval, so the host PC should automatically send a request every few seconds durin g idle periods. Once connection and initialization is complete, messages would typically be request messages from the host computer, or response messages from the chip.
ISO 14230 (Fast Init): Send 46, 03, R1,R2, R3, R4, R5 Where R1 to R5 is ISO14230 Start Communication Request Message; Normally R1-R5= C1, 33, F1, 81, 66 Receive S1, S2, .......... Where S1, S2...... is ISO14230 Start Communications Response message. Note: More than one ECU may respond in sequence. The response may also be a negative response code. A typical positive response message would look like this; S1, S2,... = 83, F1, 10, C1, E9, 8F, BD ISO 14230 (Slow Init): Same as ISO 9141.
CIRCUIT NOTES FOR THOSE BUILDING THEIR OWN INTERFACE : The schematic is shown with simple pads for signals to the vehicle and the personal computer. Below is information to wire the connector to the vehicle and also the connector to the PC serial port. --------------- VEHICLE 16 PIN CONNECTOR ----------Diagramatically, the diagnostic connector looks like this: (Use a fixed width font to view this diagram)
REAR view of male plug from interface device (where pins are inserted) (This is also the Front view of Female Connector in the vehicle) _____________________________________ \ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | / \| 9 |l0 |11 |12 |13 |14 |15 |16 |/ \-------------------------------/
Here is how to hook them up to the interface circuit. Note that only a few of the pins are used and listed here. If you are wiring a male connector, remember: The above diagram referrs to the REAR of the Male connector, and be sure to wire the male connector properly:
INTERFACE SIGNAL 12 Volts (vehicle battery) Signal ground Bus + (for VPW & PWM) Bus - (for Pwm only) L line (for ISO 9141) K line (for ISO 9141)
CONNECTOR PIN # 16 5 2 10 15 7
All other pins are not used. This cable should be no longer than 3 to 4 ft. A sheild is not needed, so if present, leave it unconnected to reduce capacitance.
--------------- SERIAL CONNECTOR -----------------The only other connector to wire is the standard 9 Pin Female D connector which plugs into your PC. Only 3 pins need be wired. REAR view of Female 9 pin D connector. (where the pins are inserted or the wires are soldered). __________________________ \ | 1 | 2 | 3 | 4 | 5 | / \ | 6 | 7 | 8 | 9 | / \-------------------/ Here is how to hook them up to the interface circuit. Note that only a few of the pins are used and listed here. Remember that the diagram refers to the REAR of the female D connector, and be sure to wire the connector properly: INTERFACE SIGNAL Out In Gnd PC SIGNAL Name Rx Data Tx Data Ground D CONNECTOR PIN # 2 3 5
All other pins are not used. Normally, you do not need a shield, so if present, the shield need not be connected. It is recomended to keep the cable length 30 Ft or less, but you may be able to make it longer, depending on the characteristics of the cable and the serial port itself.
-------------- NOTES ON COMPONENTS -----------------------Most of the resistors can be standard 5% carbon film. There is one resistor (270 Ohms) which should be 1/2 watt. If you only want to use this circuit with one or two types of protocols, you can look at the schematic and omit any parts that are not needed. For example, if you only wanted to use with VPW (Domestic General Motors), you would only need 3 wires (pins 16,5 and 2) connected at the vehicle. In this case, you could also omit several components from your circuit. Here are some examples of parts that can be omitted. If you don't use PWM, you can omit: R4, R6, R7, R8, R9, R10, Q1, Q2, D1 If you don't use ISO, you can omit: R15, R16, R17, R18, R19, R21, Q4, Q5 If you don't use VPW, you can omit: R13, R14, R23, R24, D2, D3, Q3
The components used in the schematic are not critical. Except for the pre programmed microcontroller and the crystal, you can probably get all the parts from Radio Shack, (They are usually available for less cost at electronics stores or by mail order.) You can use plain 5% tolerance carbon film resistors. If you build this circuit on a piece of perfboard or a pc board without an enclosure: Take care that you don't lay it on a conducting surface, causing it to short out. Your vehicle is pretty well protected, but you could damage the interface circuit or keep it from operating. Note that there is no reset button for the interface processor. To reset just unplug from vehicle, then replug it to the vehicle. (That will automatically reset the interface processor). Then restart the PC's software program and reinitialize the interface.