Aldl test
![aldl test aldl test](https://media.springernature.com/m685/springer-static/image/art%3A10.1038%2Fs41598-021-99961-y/MediaObjects/41598_2021_99961_Fig1_HTML.png)
Aldl test code#
The Teensy code prints out each byte decoded from the ALDL stream to my workstation. With an ECM just sitting there powered by 12V with no sensors hooked up, it spits out a predicable, always-repeating frame of bytes that is perfect for testing. The project was good motivation to convert my spare PC power supply I soldered wires onto the bottom of the ECM board to tap into the pins for power, check engine, and ALDL. I have a couple of spare ECMs and powered it with a spare PC power supply that I converted into a bench supply for this project. To find inevitable bugs, I needed a test ECM to generate ALDL data.ĮCM test points: check engine light, ALDL out, 12V, GND.
Aldl test serial#
This code is transmitting the decoded bytes over its serial peripheral for testing. In doSample(), I shift the current byte to make room for the new bit, and then set the new least significant bit to 1 only if the signal is still low (representing ALDL 1). Why 2000 μsec? To account for bit timing differences between ECMs. To detect the signal's falling edge (the start of a bit) I use attachInterrupt() to run an interrupt handler function.ĪttachInterrupt(digitalPinToInterrupt(AldlPin), handlePinChange, FALLING) It was easy to code and performance isn't an issue, so why not?
Aldl test software#
Instead, the Teensy measures the timing directly in software with a combination of timers and interrupts doing the bulk of the work. In fact, the timing doesn't quite line up, though it can be made to work, as evidenced by WinALDL and other software. Just count the logic 1 bits in the received character.įor example, using 1600 baud, an ALDL 0 bit is received as a 11111111 byte and a 1 bit is received as 00000111, depending on how the timing lines up. One way to decode is to use a standard UART set to 2400 or 1600 baud, treating each ALDL bit as a UART byte. It has a microSD card, making data logging a breeze.
![aldl test aldl test](https://i.ytimg.com/vi/4aHN9C_MUr0/maxresdefault.jpg)
I tasked one of my Teensy 3.6 Kickstarter rewards with decoding the protocol.
Aldl test pro#
I captured timing samples with a Saleae Logic Pro 8, below. And some error between ECMs can be expected.
![aldl test aldl test](https://www.abbreviations.com/images/1919180_ALDL.png)
My ECM represents a 0 with 368 μsec pulse and 1 with a 4400 μsec pulse, but timing differs between ECM part numbers. All bits start with the falling edge of this low pulse. The ALDL protocol also uses TTL voltages but the similarities end there.Īt 160 baud, each bit is transmitted in 6250 microseconds ( μsec) but instead of indicating value with voltage level, ALDL indicates it with the length of a logic-low pulse (sort of like 1-Wire).Ī short duration pulse represents logic 0 while a long duration pulse represents logic 1. TTL serial protocol, used by microcontrollers, differs only in voltage levels, using 0V to represent a 0 and Vcc (5V, 3.3V) for a 1. Typically each byte is terminated by one stop bit, with no parity bit (8N1), though other combinations are possible.Īll bit transmissions take the same time, based on the configured baud rate, and their values are indicated by voltage levels, often 12V and -12V for 0 and 1, respectively.īy Ktnbn, derivative work: Samuel Tardieu (talk), This data stream protocol is nothing like plain old RS-232 serial protocol, however.Įach byte of data transmitted in RS-232 protocol is preceded by one start bit. The ECM, which predates OBDII systems, spits out a serial data stream called Assembly Line Diagnostic Link (ALDL) at 160 baud. My Jeep is running a retrofitted General Motors #1227747 ECM, which is the brains of a mid-80's Throttle Body Injection (TBI) system found on Chevy and GMC trucks. To do that, I am using a new Teensy 3.6 microcontroller to first decode the data stream out of the ECM and then store it on a microSD card for later retrieval. I want to log my Jeep's Engine Control Module (ECM) diagnostic data reliably and inexpensively any time the vehicle is running so I can tune it to pass emissions tests and reduce pollution.