Documentation for 'Craig Moates' ALDL Scanning Software: Revision 'E6', update '004', or 'E6B004' Authored March 10th, 2001 Revised May 12th, 2001 Revision 6.004 5/12/01 Added new intro screens & option skipping steps. Added 1/4-mile / 1/8-mile pass calculations to determine critical performance parameters (screen 8). Threshold speed is selectable during program startup options. No support for 160 baud yet, only 8192, but that should change soon... Introduction: I have always had a need to fix things, especially if they aren't exactly broken. This is the result of some of that. Spurred by a mysterious 'Code-33' on my 87 305 MAF TPI, I wanted to determine when it occurred and why. To do so, I needed a program which could log data, and that is what I have created here. The bulk of my learnings cme from the 'DIY-EFI GMECM' group. Many folks helped me on the background for this, particularly guys like Andrew Mattei, Bruce Plecan, Dan Burk, Barry Tisdale, Mike Rolica, Peter Gargano, Steve Ravet, and the list goes on. To all of you, many thanks! This program is not necessarily for the weak-spirited when it comes to operating systems and minor file coding and such. For those 'Plug-N-Play' folks, I know there are several other Windows-based programs which should work fine too. However, if you're on a budget with respect to hardware (386/486 etc) and you don't mind DOS, you'll be fine with this one. It's really targeted at someone who can handle simple BASIC programming and DOS commands, particularly targeted to folks who like to tweak around. The code is based on two roots. One is QuickBasic 4.5, and the other is a utility called 'QBSerial' that I found somewhere. The compiler and serial communication routines are out on the net and easily accessible. The compiler and routines are needed if you'd like to change/update/customize the program, feel free to do so. I don't know if there is any copyright issue with using either of these programs. If anyone knows of one, please let me know and I'll be glad to tend to it. Hardware: This program is designed for use with RS-232 hardware devices such as Andrew Mattei's ALDL-to-COMport adaptor. There are several designs out there, all very similar, and most should work without a problem. Max-232 or Max-233 devices that tie in between your COM1 and the car's ALDL interface should fit the bill. Look around and find the plans to build one, or get one from Andrew. Learn about your ALDL connections, and educate yourself of the functions they supply. Tuned-Port Injection cars, such as Camaros, Firebirds, and Corvettes from 1986 to 1992, should work in this communication mode. It is '8192' baud comm, and ECMs such as the GM 1227165 and 1227730 should be good. To initiate communications, a 10,000 Ohm resistor needs to be placed across pins A and B at the ALDL in the case of the 1227165. For the '730, I don't know, but I've been told it's not necessary. Seems the MAF cars make you jump through one more hoop. Files: E6B004.zip - Latest update, contains all needed files except BRUN45.EXE (find it on the net). Youl'' need to find QuickBasic 4.5 (qb45.zip on net) and QBSerial 3.20 (qbser320.zip on net) to recompile and modify the software program. I have links on the download to where these programs are, but you can find them elsewhere also. Qbser*.* - QuickBasic Serial routines which allow customized baud rates and such QB.exe - QuickBasic 4.5 compiler and editor, allows code modification Brun45.* - Needed to execute compiled code, since stand-alone code can't be generated with Qbserial BC.exe, Link.exe - work together to allow compilation of modified source code L6.bat - Batch file to perform linking and compilation of code, use this after mods to get executable E6.bas - Source code for program, edit this to learn and then save it & compile it to make the mods E6.obj - intermediate file generated during compilation, don't worry about this one ECMdata.dat - old 165 data structure definition file, read it & compare to learnings about the datastream 165form.dat - new 165-specific datastream specification, note bit description breakouts near end 730form.dat - same as above, but for speed-density cars, bears correction/revision/addition - let me know! To edit the program: C:\whatever>qb e6.bas ...read through it, make your changes, and then save To compile the program: C:\whatever>L6.bat ...inspect its contents so you know what you're doing To run the program: C:\whatever>E6.exe The 'E6' naming is arbitrary, name it whatever you want after changing and making new revisions. The Program: I've done a somewhat fair job of commenting the code, so open it (E6.bas) up and have a read. This will give you a feel for what it does when, and how that all correlates to what the car is wanting/needing/etc. Step-by-step: Once you start the program, a screen will be displayed which asks for several options to be set. Descriptions of what to do follow. First, the datalog filename. If you just hit enter, this name will auto-increment from your last datalogging event, or you can specify a filename such as 'to-work.csv' to record your 1/4-mile pass data on the way to work. Using the '.csv' extension makes it simple to open it up in Excel later for analysis, since that is indeed the way data is stored. Next, the datalog density selection. If you select 'Full' here, all the data including bit state, all raw Byte values, and calculated values will be recorded to disk. If you want just your calculated performance data, select the 'Abbreviated' version. Play around here so you can learn what gets saved and what doesn't. Usually, A is fine. It is the defult which will occur if you just hit enter here. Next, the diagnostic option. You can enter '0' here and the program will run in the absence of a hardware device (ie. Car or ALDL interface). It will generate random numbers instead. This is just a way of testing out your computer and the program to make sure all seems good. If there's a problem with something other than the interface or ECM, it should show up in a diagnostic test. Hitting enter here will give you normal operation with the communication enabled. Next, a comm delay time. I was playing around here some, so just ignore it and hit enter if you like. This is the delay (in seconds) between byte request transmissions. Next the baud rate. I found that stability of communication was lost as I approached the max and min here, with the default right in the middle. It's not really 8192 baud, and this is a good match. If you want to play, go ahead. Next is the update time. The '0.01 seconds' works fine, but if you want to slow it down so it only collects data say once per second, then enter a '1' here. Any other number would be fine too. The most it can really get (hardware limitation) is like 8 or 9 samples per second. The ECM type is self-explanatory, pick which one you are going to talk with. This will specify what request strings to send and what datastream format to expect. It will also specify how to render the data with respect to descriptive information that is relevant to the two cases respectively. Finally, the program will let you know some information about how fast your computer is and how it is going to pace itself. Multitasking is probably a bad idea when this program is attempting to talk with your car. The more counts for 1ms, the faster your machine is. My desktop (900MHz) gives about 600. Just hit enter here to continue. Now the program will take you into another page. This is the 'Link-Up' page. Your hardware should be connected to COM1 and the ALDL of the car at this point, and the car should be in the 'ON' position or running. There should also be a 10K resistor across the A-B terminals of the ALDL if you're running a MAF 165 car. The 'Last Byte Read' data on the right lower side of the screen should flicker between '00' and 'FC'. If it flickers with something else, this could be an indication that you need a 'modified' hardware interface, one with a +5V signal (through your 7805) to the DSR pin of the COM1 port (works for me, others don't need it). If you get the flicker, just keep hitting '1' until the thing beeps for you and you get a checksum ratio that matches, and it looks like each time you hit '1' the program comes back with a data request echo and datastream return. All I can say is 'You'll know when it happens to you!'. Once successful linkage occurs, hit '2' to enter the main program. Write yourself a note to send me an Email at this point, since I'm interested to hear of folks for whom this works successfully. Let me know what hardware you're using (Car, PC, Interface, Etc). Hitting '2' will take you to 'Page 1'. Page one is all of the byte-read data coming from the car. Now that you're here, you can hit 'L' to toggle the datalogging to disk on and off, hit 'Q' to quit the program and return to DOS, or select a number 1 through 9 to go to a given page. Descriptions of the other pages follows. Page 2 gives you the deciphered bit values of several bytes, and page 3 is a continuation. Your error flags, closed loop flag, and such are all here. Look around and find what you want. If you want a summary page of specific values made up, go for it. That's why there's 9 placeholders, for you. Page 4 is the summary page I made up. It is most all of the 'calculated' values, such as gm/sec, temps, RPM, spark advance, knock counts, etc. I made it multicolored and big fonts so you can read it at a glance while you're doing a pass. Have fun with some customization here if you like. It also gives you some information about sampling rate and efficiency. Some errors crop up every now and then, and this gives you a benchmark to see what's causing them and how often they occur. Check the source code to see what the errors mean. Page 8 now is for speed passes. If you've got the nads, get some 1/4 mile times in your neighborhood. All the typical specs are present for your performance feedback enjoyment. Oh yeah, Page 9. This is where you can dump the contents of your BIN through the ALDL. This works good, just give the starting and ending addresses of what you want to dump and give it a filename. Should be a binary dump suitable for use with any of your hex editor programs such as 'WinBin'. The default memory locations are for the 165 MAF chips. What else can I say about program operation? If anything is unclear, let me know and I'll see what I can do to help. If you can't get the program to run, keep in mind that I've been running it successfully on a Win95-based (MSDOS boot) IBM Thinkpad 755C (486-75) with 8MB ram. Whether it will work with Win2K, ME, NT4, or what else I don't know. Try a DOS bootup if you're aving issues and see if that takes care of you. Let me know if it does. Double check for the 10K resistor across A & B, make sure your grounds are all good and common. Do me a favor and let me know if you're someone who is playing around with this program. Maybe I can put together a mailing list for when updates are made, and maybe you can let me know what modifications you have made that you think might be useful for others. If you find mistakes, especially with respect to calculated values and such, let me know for sure and what the corrections are. Have fun! Craig Moates fcmoates@bellsouth.net http://members.tripod.com/moatesenheimer/gmecm