Timing
JBrooks
Posts: 6
I am working on a OBDII vehicle interface which uses serial communication.· I have all the necesary documentation for Chrysler vehicles (the electrical characteristics and data format vary between manufactures and I have a Jeep). However, I need to make sure my timing is correct and the Stamp manual only goes into detail concerning the·PAUSE instruction and nothing else. I need to know how long every instruction I use takes to execute. I have experience with assembly language and believe I might be able to use the information from the memory map to determine the exact timing if I know the number of cyles per instruction. I am using the BS2SX. Where can I find this information? Any help is appreciated.
thanks,
Jeff
thanks,
Jeff
Comments
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
Http://www.parallax.com
Post Edited (Dave Andreae (Parallax)) : 7/15/2005 5:55:45 PM GMT
It will vary based on the parameters and values you use in your commands, too.
Do you have an oscilloscope? If not, it could be time to get one.·Don't rely entirely on anybody else's measurements though they could give you and idea of the code overhead in the PBASIC interpreter. The best way is to use a scope and measure the program execution time.
Ken Gracey
Parallax, Inc.
The data transfer is a little forgiving but I have the matrix orbital LCD and a couple of pushbuttons to control menu opperations that can throw off my timing.
it might be time for me to get a scope....
Thanks
Jeff
The Parallax PBASIC Stamp only supports the BASIC Language, in an interpretive form. The Javelin Stamp supports a subset of Java. There is also an SX/B compiler which supports compiled BASIC, but you can also drop into assembler, whenever you have the need to do so. The SX/B compiler supports the Ubicom SX Processors. See the Parallax web site for more information.
I suspect you will need to use the SX/B compiler and the SX processors to achieve an OBDII vehicle interface. Just for the record, there are currently OBDII serial interfaces available. I just didn't want you "reinvent the wheel" without realizing it
Regards,
Bruce Bates
I was looking in to using the Stamp for an OBD2 interface.
I'm not savvy enough a programmer so I cheated and purchased an interface chip from ELM electronics ( http://www.elmelectronics.com/DSheets/ELM322DS.pdf·)
I too have a Jeep ('02TJ) and was wanting some better idea of what was going on under the hood!
I put together the setup cct and could 'talk' to the chip using Procomm on my laptop, but never did get around to hooking up to my Jeep.
I don't have a great understanding of the OBD2 code (wasn't willing to buy the big protocol book) but this seemed like a half decent way to approach it....then see if I can simplify the interface cct and use a stamp.
It is Variable Pulse Width....which shouldn't be too bad....but I'd think you'd need to have some pretty tight Pulsein loops to catch it all.
The SX (not the BS2sx) chip would be fast enough, no doubt!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
Getting an interface might be a more realistic solution. This started as a project for a college class.·
Who else makes these chips? I knew someone had to make them I just did not know who.·
There are three main protocols (with a forth becoming the standard in '08·I think, called CAN)
Sometimes the protocols are mixed between manufactures, ie. a Ford might have VPW. I believe we need the ISO9141 ('99TJ).· Check out this website for some information.. http://www.obddiagnostics.com/index.html·This website·has some good information but it took me a while to really understand it.
I have the ISO9141-2 documentation. The protocol is pretty simple. It transmits at 10.4k Baud except for a byte of data to signal a wakeup at the very start. All the timing is measured in msec, so any stamp is fast enough.· I plan on making a scan tool that will be able to read and diagnose trouble codes along with aquire realtime data (engine RPM, speed ....).
The documentation was confusing.· The SAE manual details what the OBD system should be able to do but does not give specifics about the protocol (data rate, parity bits....) hence each manufacturer came up with their own "best way". SAE·protocol only governs emisions controls.·Chrysler has their own databus that is used to comunicate with nonemissions modules (instrument cluster, airbag.....) which most manufactures probably have their own. So it is necesary to get the vehicle specific protocol (ISO9141-2) along with the SAE manual that tells you which data should be sent.
thanks for reading my ramblings. If you have any input please offer it. I have already written the code needed to initialze the ECU but need to make sure the timing is correct.·
Jeff
Just to support what was said before: the timing issues can change depending on what you are doing- remember that PBasic is tokenized- so trying to figure out timing like you do with ASM can be tricky (if not impossible for 'general' cases)- For specific code, that's when you need to Oscope...
If you want/need to code in ASM, check out the SX chips.
Which Motorolla chips have you worked with? I'm partial to the 68HC11 myself [noparse];)[/noparse]
Ryan
an interface chip might be the best choice so far.
I used the 68HC11. I purchased the BS2SX before taking the microcontroller class. I would highly recomend a class, even at a community college and even if it is not a Parallax chip. It gave me a greater understanding of how chips work and made clear some of the topics that were very foggy to me when I read the stamp manual.
Digital design is a science, whereas analog is an artform -
You might give the Sx a try, and with the new carrier boards at such a great pricepoint too! I really enjoy the SXes, and it seems we have some similar background...
Ryan
I was not aware that they are so inexpensive. I have already started to look into it. I definately learned a lot from the the 68HC11. And I agree with the Digital and Analog statement. I'll see what I can do with what I have until I can come up with some funds for some new toys......
Jeff