160 Baud ALDL Emulator

Emulator Design

The unit uses a 9 volt battery, a transistor, two resistors, a couple of connectors, plus an attached PC to simulate the 160 baud data stream from an ECU. One of the connectors is a DB25P that plugs into the PC's parallel port (it also doubles as a no cost power switch). The transistor switches power from the battery under control of a single data bit from the PC.

The controlling script is a simple text file (generated by any ASCII text editor like Dos's EDIT or Window's NOTEPAD. The data defined in this script is repeatedly sent out to the ALDL connector via the parallel port.

Software

It's a simple DOS application called ALDLEMUL.EXE and, like other DOS applications, it's started by typing ALDLEMUL at a DOS prompt. Under Windows File Manager (or Windows Explorer in Win 95 and above) you can click on this filename and a DOS box should appear (ALT+ENTER keys will toggle between full screen and a DOS box). Other ways exist to start the application under windows (eg. using the Start and Run... etc. sequence).

An optional command line parameter specifies an alternate configuration file. If none is supplied the file ALDLEMUL.DEF is looked for in the current directory. If the configuration file is not found an error message  Can't open "xxx"  is displayed. Here is an example specifying the configuration file VN_EMUL.DEF:

    C:\>ALDLEMUL vn_emul.def  

The first line of the configuration file specifies the parallel port address to use and a number of other parameters. These are:

  1. Port address as a HEX number (usually 0x378 for LPT1, or 0x278 for LPT2).
  2. Start time in micro seconds (this is the time the start bit is LOW).
  3. Character bit time in micro seconds (the data may be HIGH or LOW during this time).
  4. Stop time in micro seconds (this is the time the stop bit is HIGH).
  5. Repeat count (the number of times the data is repeated).

The following is an example of this first line:

    0x378  500  4750  1000  10  ;port addr, start time (uSec), char time, stop time, repeat=10 

This specifies a port address of 0x378 (the 0x is required in this case), a total character time of 6250 uSec made up of 500 uSec start time, 4750 uSec character time and 1000 uSec stop time. These times generate a normal 160 baud data stream. The data will be repeated 10 times before the program closes.

Starting from the second line is the data that is to be repeatedly sent to the ALDL connector. The data may be specified as either a decimal or a hexadecimal value. The following two lines show how this may be done.

   $44     ;byte 3  PROM ID LSB
   142     ;byte 4  IAC position, # count
   $ff $ff ;bytes 5 and 6                 

The leading $ (dollar) symbol means the data will be interpreted as a hexadecimal value. The second line will be interpreted as a decimal value. Note that multiple data values may be present on a single line (separated by a space or tab character) as shown in the third line above. We suggest you use just one data value per line for ease of interpretation. The comment character ; (semi colon) indicates that no more data is present on the line.

Schematic

As I said, this design is pretty simple! The transistor is a BC548 and just about any transistor of the appropriate sex can be used in this position. For example a 2N2222 should work too. The control signal from the parallel port goes to the transistor's base. This control signal is bit-0 of the parallel port's data register. When this signal is HIGH the transistor will be driven and the ALDL signal will be LOW. The left 470 ohm resistor is used to limit the transistor's base current. The top 470 ohm resistor is used to limit the transistor's collector current to less than 20 milliamps.

As the PC's parallel port uses a number of pins connected to earth, I eliminated a power switch by connecting the battery earth to a different DB25 pin. This means that when the unit is disconnected from the parallel port, the power is also disconnected from the circuit.

As shown in the photo, I constructed the prototype on a small piece of perforated board. The ALDL out wires (the white wire under the PCB) are anchored to the PCB with a cable tie. I also anchored the battery cable with this same tie.

Download Emulator Software

ALDLemul.exe is currently about 13k bytes and it's available as zipped with VN_emul.def which is the emulator configuration file. This file is for a VN Commodore, but you can make your own, and this is probably a good starting point.

Other Details

The software uses the PC's 8253/8254 counter/timer to measure time intervals in a processor independent fashion. As I indicated above, the transistor's collector current is limited to 20 mA, this means you wont be able to drive anything like a check engine lamp like a real ALDL line can do.


To ensure the correctness of this document, we greatly appreciated your feedback on the information presented here.

last updated 8 Feb 2010 (images).

Copyright (c) 1999, Tech Edge Pty. Ltd.
Author P. Gargano, last updated 29 August 1999.

Home | Feedback | Copyright