Shop OBEX P1 Docs P2 Docs Learn Events
Need advice with a serial in/out for a project this summer — Parallax Forums

Need advice with a serial in/out for a project this summer

BigMikeBigMike Posts: 34
edited 2009-05-03 03:51 in BASIC Stamp
Hello Parallax,

This summer I plan to finally install a long overdue project to my 1981 Toyota pickup.

In reference to my question, here is what is going on..

I have already built a circuit on my BS2px24-powered BOE board that reads the fuel level in my gas tank and displays it in terms of gallons (calibrated with a POT) as well as two circuits that control the operation of my front & rear electric locking differentials including a timer that displays to a 4x20 blue LCD screen how long it took each locker to engage and disengage.

I want to use my OBD-II interface I have already purchased from http://obddiagnostics.com for other projects.

The nice thing about this interface is that it is all setup to plug directly into my OBD-II port and provides a serial Tx/Rx input/output.
Here is a data sheet of this interface http://obddiagnostics.com/DataSheet.pdf.

There are other threads on this forum that discuss the possibility of creating one's own circuit for OBD-II, but I figured this is far easier and since I already own it, it is all ready to go, just plug and play.

So now I am just wondering.....................

I have ZERO experience with serial in/out. I am assuming this interface is just a regular in/out that the stamp can read, right?

If so, then all I need to do is figure out how to interpret the signal into PBASIC and get it all setup.

Ultimately what I am looking to do is have my engine's RPM, miles per gallon, engine temperature, intake air temperature, and of course the speed (velocity) of the truck itself all displayed on my LCD screen. If too much info is available, I can simply install a push button to flip between screens of information. This LCD will be installed into my dash and permanently mounted inside my cab.

So is this possible? Has anyone ever interfaced the http://obddiagnostics.com hardware with a Stamp before?

According to the data sheet, there are just three wires coming out of the obddiagnostics hardware: Tx, Rx, and Ground.

So the question is how can I get my Stamp to communicate with that?

Regards,
Mike

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2009-05-01 12:30
    Mike,

    The serial aspect is not too complicated. Start with the Help files and the sample circuits for SERIN, SEROUT.
    Your Stamp will send a command off to the ODB then immediately get ready to receive the data.

    The stamp can send the command to the the ODB, however, your OBD device talks at 19200 baud which is iffy at best with the BS2. Probably a BS2px could do it. The issue is that the Stamp's can't buffer the incoming data stream; they have to do something with each character as it arrives.

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • BigMikeBigMike Posts: 34
    edited 2009-05-03 02:05
    Hey Tom,

    Thanks for your reply. I am really going in over my head on this but I really want to get as close to, or accomplish this.

    I sent a detailed email to the site owner of obddiagnostics.com and here is his reply:
    obddiagnostics.com said...
    Hi Mike,

    I think it may be more a lot more complicated than you're thinking. One thing
    is that you can't do without the TX line because the interface only tries to
    get data that is requested by sending it a command, for example, "Read Coolant
    Temp". After it receives a command, it will get the data from the vehicle,
    send it out to the computer (or your stamp board), then idle, listening and
    waiting for the next command.

    You'd end up essentially having to write a program to detect and initialize
    the interface, then send and receive each message for each data item you want
    to read. Its not impossible, but would require a lot of time and debugging.
    There is some basic info and examples on the web page (look under tech info,
    programmers data, near the bottom of the home page).

    The only other thing I can think of that might (or might not) be a problem is
    resetting. There isn't any way to command a reset of the micro in the
    interface other than momentarily unplugging it from the car. Normally this
    isn't a problem since its not designed to stay permanently connected. You
    might never see the problem, but occasionally its possible for the micro to
    stop normal operation if a severe power glitch or dropout occurs; like when
    cranking the engine with a really low or weak battery, especially in very cold
    weather.

    Also, I don't know how much memory your stamp board has (or how much you might
    need), so you might want to consider that too.



    Any thoughts to add, anyone?

    I don't even know where to begin. I can hook the Rx and Tx up to my stamp, but what would be the first thing I would send and if that works, how will I know what to receive?

    I am going to take a look at the examples on his website he referred to, hopefully later tonight. This would be completely awesome if I could get this to work.

    Regarding the issue of his circuit resetting, that is easy, I can just use a relay to unplug the machine each time I cycle my ignition.

    Mike
  • UnsoundcodeUnsoundcode Posts: 1,532
    edited 2009-05-03 03:11
    Hi Mike , I would start with the Initialization
    The Data Sheet Says
    The first operation is to send a single byte, 20H. This is a connect command to the chip,
    and it tells the chip that communication is to commence. The chip does not send a control byte in return, but

    responds with a single byte which is FF Hex, or decimal 255.

    Use the Stamp connected to a PC so that you can debug the data to the PC monitor , see if you can get the device to respond with FF

    Jeff T.
  • BigMikeBigMike Posts: 34
    edited 2009-05-03 03:51
    Got it, will work on this tomorrow in the day light and will report back-

    I just finished dinner and am going to read the data sheet now-

    Mike
Sign In or Register to comment.