PDA

View Full Version : Arduino



RobertISaar
02-29-2012, 01:46 AM
since we do seem to have a few programmers here, anyone mess with an Arduino before? it seems like it wouldn't be that difficult to learn it's language compared to a 6811.

Six_Shooter
02-29-2012, 04:17 AM
I have an Arduino Uno sitting on my bench.

I'm having trouble learning the program language to get it to do what I want, I understand the basics, in that you need to set up everything in the sketch and then have loops and such running, but I just don't seem to understand how to actually write it to get it to work. :(

RobertISaar
02-29-2012, 04:23 AM
people don't post examples anywhere?

it seems pretty simple to me, from taking a look at the instruction set, though i have yet to view any programs. from the looks of it, i may want an Uno for controlling some things in-car that i would have otherwise needed to use an ECM as a BCM for.

and supposedly, the instruction set is based off of C? i can't understand C at all, i tried making a tunerpro plugin or even trying to understand how a plugin works and got nowhere real quick.



i can program the hell out of motorola 68xx code, but i can't seem do anything PC based at all beyond simple HTML and it's derivatives.

88ragtop
02-29-2012, 09:10 PM
The Arduino is a lot of fun. I had been wanting to muck with microcontrollers for a long time, but found it a bit confusing and the easier stuff was very costly. The Arduino makes it easy to get started. The 'reference' hardware (even though it's nothing special) gets everybody on an even playing field that needs nothing additional for programming. The language is pretty easy to pick up on. I'm far from an expert but have been able to do a couple of good projects with some help from google. The best part is the abundance of information out there since it has become so popular.

I started with the usual blinking LED and hello world on an LCD stuff, and then fought my way through a couple of projects that were a little over my head. The first project was a whole house power monitor (based off this project: thttp://openenergymonitor.org/emon/node/58) that measures voltage and current usage, displays it on an LCD, and sends it to a linux box wirelessly via XBee modules. On the linux box I log the data, generate graphs of usage over time, etc.

The second bigger project was my own design to monitor the state of battery banks in RVs/Camping Trailers. There's some commercial products that do this, but they are big bucks and every one I played with had some quirks. Here's the circuitry breadboarded up for testing when I first started:

http://www.shadetree.org/electronics/battery_monitor/DSC03370.jpg

Once the hardware was working I etched a PC board for it:

http://gallery.shadetree.org/main.php?g2_view=core.DownloadItem&g2_itemId=8084&g2_serialNumber=2

And built the prototype:

http://gallery.shadetree.org/main.php?g2_view=core.DownloadItem&g2_itemId=8107&g2_serialNumber=2

The software is about 75% done. Discharge tracking works, and charge tracking mostly works. I need to finish up the charge portion and the rest of the user interface. Right now it's been back burnered while I get some furniture built. When I get a chance I'll see if I can make a quick video of it working..

Another thing I thought would be a fun Arduino project would be a little box with LCD to display a mini "dash" from ALDL values.

- Frank

RobertISaar
02-29-2012, 09:16 PM
Another thing I thought would be a fun Arduino project would be a little box with LCD to display a mini "dash" from ALDL values.

it does support TTL communications(either natively or via an adapter), from what i've read, which will work with ALDL.

i've considered a great many uses for it, the most exciting of which is similar, though i am leaning more toward the HUD route and have values projected onto the windshield.

88ragtop
02-29-2012, 11:13 PM
it does support TTL communications(either natively or via an adapter), from what i've read, which will work with ALDL.

i've considered a great many uses for it, the most exciting of which is similar, though i am leaning more toward the HUD route and have values projected onto the windshield.

True Heads Up would be cool. The TTL should be very easy to handle, as that's pretty much the native capability. To go to RS232 they use an interface, just like we do to talk to the ALDL. USB is also handled in a similar manner.

Does anyone know what the original powertrain engineer HUDs looked like? That could be an interesting thing to try to replicate.

- Frank

FSJ Guy
02-29-2012, 11:14 PM
Another thing I thought would be a fun Arduino project would be a little box with LCD to display a mini "dash" from ALDL values.

- Frank

That is EXACTLY why I'd love to have the time to learn Arduino. I worked with the creator of a commercially available product to do something similar and was hoping it would be available by now, but that project has stalled.

historystamp
02-29-2012, 11:33 PM
and supposedly, the instruction set is based off of C? i can't understand C at all, i tried making a tunerpro plugin or even trying to understand how a plugin works and got nowhere real quick.

i can program the hell out of motorola (http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=motorola) 68xx code, but i can't seem do anything PC based at all beyond simple HTML and it's derivatives.

I agree with you on C and the TurnerPro plugin. I've never been able fathom C that well. I guess I don't agree the philosophy behind C. I've taken a look at the C source to BitHoist & that makes my head spin. Took me several hours to find where the author was parsing the command parameters.

I assume you could program it in assembler if you want.

A lot of it will be how well the manufacturer documents the micro. With C, you end up having to learn how the hardware works then having to learn how to access the hardware through C. In assembler, your good to go once you learn the hardware.

Anyway, programming in C on one of these boards should be easier because you will be writing the code in your own style. From a C coding perspective, I think C is more suited for the micro processor environment. You can avoid a lot of the complexities of C. I think C falls down in the large system programming environment.

I'm familiar with one or two of the Micorchip pic controllers.

Robert

RobertISaar
03-01-2012, 12:47 AM
Does anyone know what the original powertrain engineer HUDs looked like? That could be an interesting thing to try to replicate.

the GM instrumentation module.... that thing will never see the light of day. i can guess what some of it does based on my disassembly of A1, but from the way it's been described before, it was essentially a datalogging/real-time data viewing device, so not that much different than tunerpro RT itself.

Six_Shooter
03-01-2012, 04:41 AM
Yeah, my main reasoning to start with the Arduino was to build a display for my dash, much like the Tuner View II, since I'm getting ZERO after sale support for the device now, got a couple bugs worked out, and then was told politely to "Go fuck myself"...

I know the Arduino can do it, it's been matched to the Honda ECMs, and Megasquirt for the same purpose, I just need to learn the language.

From what I can see, a MAX232 style circuit will be needed to interface with the serial RX and TX lines on the Arduino itself, after that, I'm almost lost. The basic principle I understand, assigning pins, and basic layout of some stuff, but I haven't dove too deep in actually writing the code, since there were some things that didn't make sense to me, and it's been a few months since I have played it with it.

I did the usual LED flash and Hello World stuff as well, I then went to adding LEDs, flashing together and alternatively, bucket brigades, with and without delays between LED on time, glowing LEDS, etc written by me, by that didn't get me even close to where I need to be.

I need to get back to working on that sketch.

RobertISaar
03-01-2012, 04:45 AM
that doesn't sound like Moates...

i really need to pick up an Uno and play with it, i mean worst-case scenario, i pay $30 for a board that i could resell if i can't figure it out either.

FSJ Guy
03-01-2012, 05:03 AM
Craig Moates is not the creator of TunerView. He is a reseller. HRTuning sells the Tunerview. It looks like a nice setup. If only it were compatible or open source. But it's not. :-(

I just need to take the time to learn Arduino. And bug a friend of mine who DOES know it.

88ragtop
03-01-2012, 05:20 AM
From what I can see, a MAX232 style circuit will be needed to interface with the serial RX and TX lines on the Arduino itself, after that, I'm almost lost. The basic principle I understand, assigning pins, and basic layout of some stuff, but I haven't dove too deep in actually writing the code, since there were some things that didn't make sense to me, and it's been a few months since I have played it with it.

Take a peek here at the hardware reference (we'll use the Uno since it's the most current): http://arduino.cc/en/Main/ArduinoBoardUno

You can see in the docs that digital pins 0 & 1 are RX & TX out of the microcontroller. At this point it is TTL level data. On the Uno, a seperate microcontroller (ATmega8U2) is used to convert that TTL to USB. On the older boards, an FTDI chip did the TTL to USB, and on the older serial stuff, a MAX232 (or similar) was used for the same purpose.

Anyway, since you have TTL level data at 0 & 1, you should be able to go straight from those points to the ALDL with no real additional circuitry required.

If someone is familiar with the ALDL datastream and can give us a couple of pointers, a quick overview, or even a link to a doc, we could all give it a shot right here. I'm pretty sure I have a few 7730's laying around somewhere for testing. I'm not familiar with how the ALDL is handled, if there's a "handshake" or something needed, or whatever - I've always been lucky enough to be able to use existing software to get the info. The needed data might be right here on the board, or even available in a tunerpro ADS. I've never looked, but will do so.

I have an Uno for the rare occasion I want to mess around with one of the sheilds. Most of the time when I'm prototyping my own junk I use either a Bare Bones Board or a Really Bare Bones Board from Modern Device (http://shop.moderndevice.com/collections/arduino-freeduino/). I like that they plug directly into a breadboard vs. having to flywire it. Either way the software is the same.

- Frank

FSJ Guy
03-01-2012, 05:32 AM
I haven't looked too deeply, but I suspect that the info is in the TunerPro ADS files. That file would also tell you if you needed to send any commands to the ECM (handshaking) to start the output. But I can't see that as being too difficult. <shrug>

They also have an Arduino bluetooth module. What would really be awesome is an interface that would output the data right to your smartphone or iPod Touch. Then you'd need Apple's SDK to write a program that would allow you to display the info in whatever manner you wanted. Sort of like a TunerPro dashboard right on your phone. But I digress...

EDIT: The bluetooth module is no longer available.

RobertISaar
03-01-2012, 05:33 AM
ALDL is just 8192 baud, 8N1 format, the sending procedure is:

1. send a message to a module

in this message are a couple of different things, 1st being the module that is being addressed. 2nd is the length of the message. 3rd (since we're dealing with polling for ALDL data) is the specific mode message we want sent back(a mode 1 message). depending on the mask, this can be 1 byte or 2, depending on how many messages there are in the mode 1 message system. assume it's a simpler unit and it's only 1 byte. 4th byte sent is a 2's compliment checksum of the entire message.

2. the PCM will now dump the requested stream (most do ~63 bytes of data), and then a 2's compliment checksum of all of the information it sent.

the first byte the PCM sends back is the module identifier, followed by message length, followed by the mode requested, followed by the data, followed by a 2's compliment checksum.



simple enough explanation?

88ragtop
03-01-2012, 05:47 AM
Thanks Robert, that is perfect! I actually just opened the $A1 ADX to see you wrote it :)

So (using $A1), if I am understanding correctly, I would:

- Send the hex string F4 57 01 00 B4
- Receive 63 bytes of data to be processed/displayed
- Take a short break
- Do this over and over again

And as far as processing the data, I would find the TPS value as the 9th byte of the response.

Is that correct? If so I guess I'm going to go crawl around the attic and see if I can find a 7730.

- Frank

RobertISaar
03-01-2012, 05:55 AM
you'll actually receive 67 bytes of data back from the PCM, 3 for the header, 1 for checksum, the other 63 for actual values.
no break needed, you can immediately retransmit after the received checksum is finished. i get ~10.67 samples averaged per second on TP.
and yes, TPS A/D is the 9th "value" byte that will come back. the 10th is TPS %.

if you get this pounded out, i'll have to send you the info on mode 4 stuff.... i'm sure that would be quite a hit as well.

88ragtop
03-01-2012, 06:02 AM
Good deal. This doesn't sound too difficult to pull off. Time to go dig up an ECM and start playing around.

FSJ Guy
03-01-2012, 07:58 AM
Damn. Now I'm going to have to buy an Arduino and a bunch of dot matrix displays.

I wonder if you can drive Nixie tubes with an Arduino?

RobertISaar
03-01-2012, 08:06 AM
they can natively drive ~40mA.... i imagine a good FET or two could drive that up though.

EagleMark
03-01-2012, 08:07 AM
You guys playing with this Arduino thing and the other day when I was searching for PWM controller for jim_in_dorris I found one for it!

RobertISaar
03-01-2012, 08:11 AM
i always have uses for a good MCU, whether it's to control my refrigerator the way i want it to run, or if i want to build up my own retained power circuit for the car to power the radio/power windows/etc for 5 minutes after the ignition is off or some other crazy project.

i can do all of these things with a motorola 6811(GM OBD1 P4 ECM), but they aren't exactly easy to come by these days for as cheap a price and as versatile for off the wall applications.

1project2many
03-01-2012, 09:41 PM
Just a few notes for thought...
"ALDL is just 8192..."
Some calibrations play very nicely with this rule. Some do not. $58, for example, is notorious for not working with ALDL displays or software which works fine on $8D. Of course even $8D doesn't work like $8D if it's installed in a Corvette. And there are the Olds / Buick / Caddy systems where "somebody else" wants to be in charge.

"Has anyone seen the GM Display...?"
Rumor has it, or had it, that Doc Plecan (Grumpy from thirdgen) had one for a while. While "I never saw it," it might have been about as wide as a small computer desk, about 8-10" deep, and maybe that much tall. It might have had controls to allow one to change specific values in memory or to simulate sensor data to work through bugs and it might have had various points to connect additional instrumentation. If painted it would have been gray, and it might have looked like images of NASA equipment in the 1960s. It definitely wouldn't have appeared to be the powerful tuning device that it was. Lockers is a hobbyist level version of the GM HUD.

"i can't understand C at all" "In assembler, your good to go once you learn the hardware. "
C is a high level language. You say "Go get this done" without worrying about how it gets done in the hardware. After writing your program it's the job of the compiler to work out the details for the processor. With proper compilers, an EFI control algorithm written in C would work in a 68HC09/11 system, and 68000 system, an Intel based system, or even in a PC based system. The programmer should only need to know how the control algo works, not the details of implementation. In assembly you are making the decisions about how the code operates, what data structures to use, how to use memory in a way you want. In C it's the job of the compiler to translate your instructions to machine code. There are plenty of arguments for and against higher level languages over assembly language for microprocessors but each has it's strength and either can be the best choice in a given situation.

edit: Didn't have time to say this originally. Seeing this conversation here is impressive and rewarding. I'm willing to help if needed with coaching on C or C++ related stuff. Four years chasing CS/EE major gave me a fair amount of practice coding in these languages and if I can give back I'm more than happy to. This is not an offer to do all code writing (boss is in the hospital and I'm spending 80-85 hrs/week at work covering his job and mine) but definitely an offer to help with WT??!!! questions.

RobertISaar
03-02-2012, 01:41 AM
i was thinking about it...

J1850 VPW: an Arduino can probably be used as a VPW to USB interface, couldn't it? and with the amount of RAM available, i'm thinking it could be the basis for an OBD2 flashing cable without any issues. no idea about CAN stuff, but VPW should be covered.

i need to research this some more, but it looks like it's possible to use it as such.

historystamp
03-02-2012, 02:21 AM
Here is an implementation by Luke Skaff, "Automotive Diagnostic Interface."
http://lukeskaff.com/wordpress/wp-content/uploads/Senior_Project_2007_Automotive_Diagnostic_LCD_Inte rface.pdf

There is a complication with ALDL. The ALDL is bi-directional on one pin. With separate input & output pins, you need to merge this data onto one wire. Luke show a circuit for doing this.

Robert

RobertISaar
03-02-2012, 02:33 AM
SLIGHTLY inaccurate at times, since mode 2 actually dumps 64 bytes per message, IIRC.
mode 4 being deactivated is also false.
ECM reading only up to 6375RPM? also false, i've had nAst1 code run up to 12,750RPM on a bench and nothing bad happened.

otherwise, a good project.

EagleMark
03-02-2012, 03:19 AM
That was some really good info from the date though!

gregs78cam
03-02-2012, 03:47 AM
I actually built the 2 Square wave signal generator to hook up to my still needing to be built test bench. It does work nicely.

After looking over some of this thing, I may have to order one and start playing with it. It would probably work great for some of the things I am wanting to implement.

jim_in_dorris
03-02-2012, 11:57 PM
Well, I haven't spent any time thinking about this, but would this work to base a ECM test bench around? It should would be a quick way to get into a test bench.

Six_Shooter
03-03-2012, 04:35 AM
It could possibly be used for a test bench, but I would use the Megasquirt Jim Stim for a test bench, instead of the Arduino.

EagleMark
03-03-2012, 04:50 AM
Here's a thread we had awhile ago on EFI test benchs.

http://www.gearhead-efi.com/Fuel-Injection/showthread.php?9-ECM-Test-Bench

FSJ Guy
05-17-2012, 05:22 AM
Reviving a (semi) old thread. :D

I got my Arduino Uno today and was playing with it. I have a very limited understanding of the code. I can modify the Blink code and played with IF and ELSE statements.

Can someone point me to some good tutorials on reading serial data? The only serial read functions I see just return the first byte of data. The 16197427 ECM requires handshaking IIRC and outputs a stream of data and then waits for another prompt before outputting data again. At least that's how I understand it.

I guess I need a way to read the entire string (store it in memory, perhaps?) and then pull out the various data as I need it.

gregs78cam
05-17-2012, 05:51 AM
Some of what you are looking for may be found on page 22 here: http://lukeskaff.com/wordpress/wp-content/uploads/Senior_Project_2007_Automotive_Diagnostic_LCD_Inte rface.pdf

EagleMark
05-17-2012, 05:58 AM
Commands for accessesing data in $0D are from ALDL.ds file A217.


MODE 1 (TRANSMIT FIXED DATA STREAM)
ALDL REQUEST:
- MESSAGE ID = $F4
- MESSAGE LENGTH = $57
- MODE = $01
- MESSAGE = $00
- SUM CHECK
THE PCM WILL RESPOND WITH THE FOLLOWING MESSAGE:
- MESSAGE ID = $F4
- MESSAGE LENGTH = $95
- MODE = $01
- DATA BYTE 1
.
.
- DATA BYTE 63
- SUM CHECK

Six_Shooter
05-17-2012, 05:59 AM
Yep, I'm currently cleaning off my computer desk in hopes of getting back to this.

RobertISaar
05-17-2012, 06:11 AM
and i'm still brainstorming on what all i can monitor/command with one as a BCM. recent additions include those interesting electrically controlled struts seen on some of the higher end GM cars from the early 90s and onwards.... the current struts in the 91GP are adjustable manually, but on max setting, they will shatter hips if you're not expecting a road transition. i'd like to just press a button and go from a fairly soft touring mode to track ready.

now i just need to figure out how to get them to work with the W platform. :laugh:

Six_Shooter
05-17-2012, 09:07 AM
Yeah, I also thought of a couple simple, but possibly cool things I could do with the Arduino and some of the existing circuits in my car...

I'm going to get serious about this display, since I REALLY want something that will display more than what I currently have on my TVII.

Six_Shooter
06-04-2012, 01:18 AM
Well, I'm back to working with, or on, or maybe against(?) the Arduino...

I have decided that the ALDL Display is a bit above me right now, so I'm attempting a "simpler" project, a simple display to mount on/in my dahs or on top of my steering column that will take direct inputs and display something on an LCD display.

Since I replaced my OEM tach with an aftermarket I lost my turn signal indicators, though I have LEDs in a small ABS panel attached to the top of my steering column, it just lacks the finsihed look I want, even using triangular LEDs wouldn't satisfy me. I also don't have an OEM CEL, so I thought what better way to figure out this programming than to have something that will display turn signal indication and "CHECK ENGINE" right on an LCD?

So far I have it displaying the 3 functions from 3 separate inputs. The only issue is that the else statement to clear LCD affects all but the last item in the loop. I need to figure out a different way to reset the LCD, or maybe use switch statements, which I'm about to attempt.

Eventually I want it to display multiple things on the screen, maybe not only the CEL, but which code is set...

I also need more switches/buttons to make testing easy LOL, I have one one button, that I scavenged this morning, I'm sure I can find more if I look hard enough.

EagleMark
06-07-2012, 05:32 PM
Here's an idea for an end goal, pretty sweet unit but in the $1200 range...

http://www.autometer.com/dataloggers.aspx

Six_Shooter
06-07-2012, 07:34 PM
Here's an idea for an end goal, pretty sweet unit but in the $1200 range...

http://www.autometer.com/dataloggers.aspx

Yep, in the end it's many of the same features I want, but it will take me a while to get to that point.

FSJ Guy
06-27-2012, 10:16 PM
Here is an implementation by Luke Skaff, "Automotive Diagnostic Interface."
http://lukeskaff.com/wordpress/wp-content/uploads/Senior_Project_2007_Automotive_Diagnostic_LCD_Inte rface.pdf

There is a complication with ALDL. The ALDL is bi-directional on one pin. With separate input & output pins, you need to merge this data onto one wire. Luke show a circuit for doing this.

Robert

If you google the MAX232 converter circuits, they show a diode guarding the Tx pin and a 1K resistor on the Rx pin of the MAX232. They are tied together after that and go to the ALDL data pin. I'm thinking that maybe that would work with sending/receiving data directly to the Arduino. I tried it with simply tying the Tx and Rx pins to the ALDL pin. It did not work.

FSJ Guy
06-28-2012, 02:45 AM
Here is the link for the Max232/8192 baud interface: http://www.techedge.com.au/vehicle/aldl8192/8192hw.htm

I added the diode and resistor to my dataline. I can now successfully update my Arduino with the ALDL connected to it. I couldn't do that before when simply tying the Tx and Rx lines together.

But I still have no response from the ECM. I'm not sure if I've got the request code wrong (sending the wrong data, a software issue) or if the diode and resistor simply don't work. <shrug>

I should have more time this weekend to play with it some more.

FSJ Guy
06-30-2012, 08:49 AM
For anyone who cares or randomly finds this thread: A short update. I found my old serial monitor logs from last year.

It seems that the 161974327 ECM needs a certain message sent to it in order for it to reply with data. But the message that Tuner Pro says it's sending and the ACTUAL message being sent are different. The ACTUAL message has some extra bytes in it. Carriage return? <shrug> I will try adding those and see what happens.

EagleMark
06-30-2012, 09:10 AM
This is what the ALDL file says works and I beleive the same as the TunerPro file, except there has always been an issue with an extra byte or some masks a pause since TP V5. Some say it's the sum check, I thought it was the Data Byte in bold?


MODE 1 (TRANSMIT FIXED DATA STREAM)
ALDL REQUEST:
- MESSAGE ID = $F4
- MESSAGE LENGTH = $57
- MODE = $01
- MESSAGE = $00
- SUM CHECK
THE PCM WILL RESPOND WITH THE FOLLOWING MESSAGE:
- MESSAGE ID = $F4
- MESSAGE LENGTH = $95
- MODE = $01
- DATA BYTE 1
.
.
- DATA BYTE 63
- SUM CHECK

FSJ Guy
06-30-2012, 07:49 PM
The serial monitor was showing the following values being sent to request data: (all hex data)

4B 05 49 F4 57 01 00 B4 99

So the 0xB4 and 0x99 are extra. Maybe 0xB4 is the sum check? <shrug> I may have a chance to work on it tonight.

I'm still not sure I'm sending the commands correctly, so it's still up in the air as to which end isn't working, the actual commands or the data transmit.

I've got a nice display formatted out on a 4x20 LCD. :D I just need valid data to feed it.

RobertISaar
06-30-2012, 08:14 PM
B4 looks to be checksum. in fact, i just did a test in tunerpro and F4 57 01 00 uses a checksum of B4.

FSJ Guy
07-01-2012, 07:52 AM
So here is my code below

zero is an int value of 0 because Serial.write(0x00) doesn't compile for some reason.

Serial.write(0x4B); // Packets derived from Serial Monitor
Serial.write(0x05);
Serial.write(0x49);
Serial.write(0xF4);
Serial.write(0x57);
Serial.write(0x01);
Serial.write(zero);
Serial.write(0xB4);
Serial.write(0x99);


/*
Serial.write(0xF4); // Packets from TP5 ADX File
Serial.write(0x57);
Serial.write(0x01);
Serial.write(zero);
Serial.write(0xB4); // Sum Check
*/




/*
Serial.write(0xF4); // Packets from online PDF Project
Serial.write(0x56); // Note that this is different than ther ADX file AND the Serial Monitor data
Serial.write(0x01);
Serial.write(0xB5);
*/



if (Serial.available() > 0) {
incomingByte = Serial.read(); // read the incoming byte:


lcdPosition(90); // Show Data here:
LCD.print("Data! ");
LCD.print(incomingByte);


}

Can anyone verify that this is the correct way to be sending these commands? I have the ALDL connected with the diode and resistor configuration which I have used with TunerPro and it acquires data to TunerPro that way. (It still disconnects when I start the engine, but that's another thread.)

I could try using the circuit in that PDF school project, but I'll have to figure out how to break out the DTR pin on the processor chip. I'm not really interested in doing that right now.

shimniok
07-03-2012, 07:21 AM
FSJ Guy: that code looks good. I have to look at the datasheet for the max232 to see if it's output +12/-12V or TTL serial.

I would just use the circuit in that PDF doc which uses a couple of PNP transistors to interface the two serial lines on the arduino with the one aldl bi-directional serial line.

If you want to read multiple bytes from serial in Arduino you need a loop or you need to call Serial.read() multiple times. Of course, if you need to send some bytes, then get some bytes, and repeat that, then that code can appear in the loop() function. In Arduino land, the microcontroller calls your setup() function once. Then it basically does a loop calling the loop() function like:

while(1) {
loop();
}

I will try and get back here with more info. I've done quite a bit of stuff with Arduino but very little (so far) with GM EFI systems -- that's soon to change as I convert my Grand Wagoneer to EFI as FSJ Guy has done.

One though for those not comfortable with C, you might look into one of the BASIC options like the BASIC Stamp (there are a couple others). But you might as well start with C and with Arduino as it has a MASSIVE following by lots of non-technical as well as technical folks, so there are loads of examples and help to be had.

Michael

EagleMark
07-17-2012, 11:56 PM
Yep, in the end it's many of the same features I want, but it will take me a while to get to that point.

http://ecomodder.com/forum/showthread.php/mpguino-release-one-workspace-2115.html

creeper
10-07-2012, 04:30 AM
I have been checking into this and I guess we are not the only ones that have had this idea! Just came across this http://arduino.cc/forum/index.php/topic,8218.0.html

Six_Shooter
10-07-2012, 06:20 AM
Yep, plenty of this same idea floating around, many for OBDII. There is an OBD0 and OBD1 Honda display project that has been documented as well. The communication with the ECM is a little different, though similar to communication with a GM ECM. For the Honda the serial communications connects directly to the board in the ECM, that has separate tx and rx pins, and queries for each parameter, instead of being spit out in a stream it seems.

Speaking of Arduino, is it bad, that after doing 5 C programming labs at school (and several hours at home), that I want to end sentences with ";"? lol

jim_in_dorris
10-07-2012, 09:53 AM
Probably not as bad as starting the sentences with ;:laugh:

FSJ Guy
10-07-2012, 07:27 PM
Speaking of Arduino, is it bad, that after doing 5 C programming labs at school (and several hours at home), that I want to end sentences with ";"? lol

Yes. And even worse that I thought it was funny, too. :D

phonedawgz
10-18-2012, 06:36 AM
The MAX 232 circuit is used to convert a serial RS232 signal to ALDL. There are two parts to the circuit. The first is the MAX232 chip itself. The chip converts the RS232 signal to a TTL signal. Then from there the diode and resistor converts the TTL signal to the ALDL 8192 signal.

Since the Arduino pins are already a TTL type signal, there is no need to use the MAX232 chip. I don't believe you can get away with the simple diode/resistor interface to convert an Arduion TTL signal to the 8192 ALDL interface however.

I also don't believe you can get away with the 'just tie them together' trick to interface the TTL to 8192 ALDL either.

// idk maybe it was funny