Serial Protocol
J Ludwig
Posts: 19
Hi All,
I'm trying to communicate serially with a Prop to a GM Engine Control Unit ALDL port. It calls for 8 bits, no parity, and 1 stop bit, 8192 Baud. My command string is "$F4 $57 $01 $00 $B4". When I send that out using FullDuplexSerial.spin does it automatically include the stop bit or do I need to do something else? I have been able to read the data out with the Prop by tapping into the serial port receive line of my laptop running TunerPro software but can't get the command string to work using only the Prop. I'm using a MAX232 as an interface between the Prop and the serial line. The ECU is a TTL level interface on a single wire and I purchased a cable that converts to RS-232 with both Tx and Rx lines.
One other question, does serial transmit LSBit first or MSbit first?
The command string code I'm using looks like this:
JL
I'm trying to communicate serially with a Prop to a GM Engine Control Unit ALDL port. It calls for 8 bits, no parity, and 1 stop bit, 8192 Baud. My command string is "$F4 $57 $01 $00 $B4". When I send that out using FullDuplexSerial.spin does it automatically include the stop bit or do I need to do something else? I have been able to read the data out with the Prop by tapping into the serial port receive line of my laptop running TunerPro software but can't get the command string to work using only the Prop. I'm using a MAX232 as an interface between the Prop and the serial line. The ECU is a TTL level interface on a single wire and I purchased a cable that converts to RS-232 with both Tx and Rx lines.
One other question, does serial transmit LSBit first or MSbit first?
The command string code I'm using looks like this:
PUB Main | i, r, d, Rx request[0] := $F4 request[1] := $57 request[2] := $01 request[3] := $00 request[4] := $B4 ser.start(7, 6, %0000, 8192) 'Start ALDL communications with FullDuplexSerial term.start(12) 'Start TV Terminal waitcnt(clkfreq + cnt) 'Give methods chance to start term.str(@title) 'Print Title on TV screen repeat repeat i from 0 to 4 'Send command string to ECU ser.hex(request[i],2)
JL
Comments
I've done a lot of ODBII work but it has always been with an ELM IC in between largely to make the code on the uC side a little more straight forward. Also if you want to go direct their datasheet has a schematic but you will need to work out the protocol in code.
JL
we got the same lastname (Stefan Ludwig)
from your posting it is not really clear to me what you have tested.
If you "tapped in the serial port receive line of your laptop" do you mean propeller
laptop---ECU and receiving works this way ?
or do you mean propeller
laptop laptop receives data send from the propeller?
the max232 does voltage levelshifting from 0V/5V to +-12V. So if your ECU is at TTL-level 0V/5V you just need 4.7kOhm-resistors to limit the current into the propeller-io-pins down below 500microampare
that the internal clamping diodes can drive away the voltabe above 3.6V. Hope you haven*t connected the +-12V side of the max not to the propeller.
Make tests with most parts as well known working properly. This means connect a PC through a PC +-12V to 00/5V voltage-levelshifer (MAX232) with the ECU directly sending the request string
to test if the string is right and the ECU is answering
connect the propeller-chip to the PC-COm_port testing does the propeller send the right request-string
if this works connect propeller to ECU. Maybe you can solder an Y-cable to hook-up the PC-comport in parallel to listen to the traffic between propeller and ECU
keep the questions coming
best regards
Stefan
I have software called TunerPro RT in my laptop that allows me to monitor values in my engine's computer and I have a cable that converts the ECU's TTL level (I think) to RS-232 levels to feed the laptop. My Prop has a MAX232 connected to convert the voltage levels. What I did was open up the serial cable (essentially a Y-cable) and connect the high level side of the MAX232 to either TX or RX and was able to read data with the Prop on the way to and from the ECU to the laptop. My problem is I can't get the ECU to recognize the command string from the Prop by itself. I've tried connecting directly to the ECU, I've tried using a 74HC04 as a level shifter to bring the 3.3v output from the prop up to 5v, tried both inverted and non-inverted and nothing seems to work. I'm questioning my programming at this point. And, yes, I'm using a resistor in the input to the Prop.
JL
If you're supposed to send just the values, change:
To:
Your comments may hold the solution to my problem. When I was able to monitor the datastream, the output was in indiviual bytes. I was able to read and display in hex and convert to individual byte values, then identify the parameters according to the datastream definition A138.DS. It lists an initial response from the ECU as $F4 $56 $01 followed by 59 data bytes. I converted the definition file to a text file so it can be opened with notepad if you care to look at it. I believe the ECU is looking for byte values, not ASCII values. I will change my code per your suggestion but will be Monday before I have a chance to try it.
Thanks for your comments,
JL
Here's a picture of the display with the engine idling.