DIY PROM Do It Yourself PROM chip burning help. No PROM begging. No PROMs for sale. No commercial exchange. Not a referral service.

Care to check my programming?

Thread Tools
 
Search this Thread
 
Old Aug 30, 2005 | 10:42 PM
  #1  
Synapsis's Avatar
Thread Starter
Supreme Member
 
Joined: Dec 2001
Posts: 2,179
Likes: 0
From: Tucson - MdFormula350 = Post uberWhore
Car: Sexy
Engine: Stock
Transmission: Slipping
Care to check my programming?

I haven't coded assembler since 1983 and I'm taking a course in it (which started a week ago). I wrote some code and I want to make sure I'm in the right direction.

My goal is to read a raw WB voltage on pin F14 (0-5V) and output the value as an 8-bit number in ALDL location #38, Oil A/D value.

0917 FDB $0034 ; WBO2 storage point in RAM for ALDL

2000 LDAA #$00 ; Set accumulator for Channel 0
2002 JSR $F0DA ; Read U5 A/D
2005 STAA $0034 ; Store value in RAM
2007 LDX #$00E2 ; Execute line removed for insertion point
200A RTS ; Return from Subroutine

4C90 JSR $A000 ; Read WB

I know all the code locations are off $8000, this is how TunerPro and my hex editor read the bins.
Reply
Old Aug 30, 2005 | 10:45 PM
  #2  
Synapsis's Avatar
Thread Starter
Supreme Member
 
Joined: Dec 2001
Posts: 2,179
Likes: 0
From: Tucson - MdFormula350 = Post uberWhore
Car: Sexy
Engine: Stock
Transmission: Slipping
And as a note to the Moderators, the "Assembly Basics : The Checksum Calculation" link in the faq points to newbie question about bolt-on parts.
Reply
Old Aug 30, 2005 | 11:44 PM
  #3  
1981TTA's Avatar
Member
 
Joined: May 2004
Posts: 289
Likes: 0
From: SE Michigan
Car: 81 Turbo Trans Am
Engine: 301 T
Transmission: 200-4R
I'm not certain of the mask you're using to knowledgeably comment on the A/D read routine specifics. However, the general approach appears to be good.

Two questions :

1) Why is "2007 LDX #$00E2 ; Execute line removed for insertion point" there?

2) Unless you need to look this value up in multiple loops, why not just paste in the ldaa/jsr/staa lines in the one area you need and save all the jumping around....?
Reply
Old Aug 30, 2005 | 11:56 PM
  #4  
Synapsis's Avatar
Thread Starter
Supreme Member
 
Joined: Dec 2001
Posts: 2,179
Likes: 0
From: Tucson - MdFormula350 = Post uberWhore
Car: Sexy
Engine: Stock
Transmission: Slipping
Oh sorry, this is AUJP.

1) I inserted the jump to my subroutine in the BLM correction code mainly because the WB bin I was learning from had it there. I put the jump to my subroutine there, then run the command I took out before returning so it executes the same.

2) I'm working off a bin, not compilable source code. If I just pasted it somewhere I'd have to shift all the addresses from that point on.
Reply
Old Aug 31, 2005 | 12:08 AM
  #5  
Z69's Avatar
Z69
Supreme Member
 
Joined: Sep 2003
Posts: 1,409
Likes: 1
From: Texas
That's how the patches I've seen do it.
The Davis WB does and looks a lot like that IIRC.
The Flaming Head guy has a bin that uses the FP volts code instead. So no JSR's needed.
Don't forget the $8000. It messes up the compiler.

-No one has bothered to post a relocatable AUJP asm yet.
JP & I will get to it eventually.
Reply
Old Aug 31, 2005 | 12:16 AM
  #6  
Synapsis's Avatar
Thread Starter
Supreme Member
 
Joined: Dec 2001
Posts: 2,179
Likes: 0
From: Tucson - MdFormula350 = Post uberWhore
Car: Sexy
Engine: Stock
Transmission: Slipping
Good news. Now I just have to search for making a checksum and I can try it out.

I couldn't tell you which WB patch I studied to learn how to do it since I have so many on my drive. Most of them have table lookups to convert to AFR where I need to convert to Lambda. I decided to just make an easy raw count output and I'll do the calculations in Tunerpro.

And I don't have a compiler, I have a book on the 68HC11 I'm getting opcodes from and a hex editor. The I/O Addressing thread is a lifesaver, though.
Reply
Old Aug 31, 2005 | 02:16 PM
  #7  
Z69's Avatar
Z69
Supreme Member
 
Joined: Sep 2003
Posts: 1,409
Likes: 1
From: Texas
Originally posted by Synapsis
Good news. Now I just have to search for making a checksum and I can try it out.

And I don't have a compiler, I have a book on the 68HC11 I'm getting opcodes from and a hex editor. The I/O Addressing thread is a lifesaver, though.
Check sum??? TP will do it for you.....

Compiler- The source code for dummies thread lists where to get a free compiler. The AUJP hac used the AS6811 from Dewtronics IIRC. I use AS11 for some patches. And ASHC11 from Techedge for the more involved ones that make AS11 choke.
All of which I got for free.
Reply
Old Sep 2, 2005 | 12:31 AM
  #8  
Synapsis's Avatar
Thread Starter
Supreme Member
 
Joined: Dec 2001
Posts: 2,179
Likes: 0
From: Tucson - MdFormula350 = Post uberWhore
Car: Sexy
Engine: Stock
Transmission: Slipping
Well, hex edited in my code, used TP to do the checksum, pop the chip in and it works without an SES! So I figure, sweet! Let's go for a ride and check out how my tune is.

Get around the block, both my narrowband and my wideband go full lean on the computer, all the lights go out on my A/F gauges on the dash, car almost dies. Pop the hood and my fuel pressure is 30, 27, 25... I managed to limp it home but it won't even go over 38 if I crank it all the way up now.

It was good while it lasted for 5 minutes. =/
Reply
Old Sep 2, 2005 | 12:41 AM
  #9  
Z69's Avatar
Z69
Supreme Member
 
Joined: Sep 2003
Posts: 1,409
Likes: 1
From: Texas
And you know for at least an instant. You thought that you had programed something wrong
Reply
Old Sep 2, 2005 | 12:51 AM
  #10  
Synapsis's Avatar
Thread Starter
Supreme Member
 
Joined: Dec 2001
Posts: 2,179
Likes: 0
From: Tucson - MdFormula350 = Post uberWhore
Car: Sexy
Engine: Stock
Transmission: Slipping
Actually, yeah. So I pulled over, stopped Datamaster, popped in the "Uh oh" chip, and my narrowband O2 went to 210 mV and stayed there.

After looking at the data, the delay between the NBO2 and the WBO2 detecting the changes is practically non-existant. I was worried about a delay having it in the driver's side pipe but under the starter area, but there's none.

Here's the graph from me guessing if I was going to get home or not. Notice the NB at 58 mV and the WB reading almost free air. 167 counts is 21.2:1 AFR, that's way beyond.
Attached Thumbnails Care to check my programming?-doh.jpg  
Reply
Old Sep 3, 2005 | 12:22 AM
  #11  
junkcltr's Avatar
Supreme Member
iTrader: (1)
 
Joined: Jan 2002
Posts: 4,432
Likes: 1
From: garage
Engine: 3xx ci tubo
Transmission: 4L60E & 4L80E
Originally posted by Z69
I use AS11 for some patches. And ASHC11 from Techedge for the more involved ones that make AS11 choke.
All of which I got for free.
I recommend ditching that ASHC11 assembler. You can download the source for AS11 and recompile using MINGW. Might as well get MSYS while you are at it.
Once you compile it with a large memory model all the problems with compiling a large file with a lot of comments will be gone.

Junk
Reply
Old Sep 3, 2005 | 01:34 AM
  #12  
Z69's Avatar
Z69
Supreme Member
 
Joined: Sep 2003
Posts: 1,409
Likes: 1
From: Texas
The patch wasn't all that big.
But it included some stock code that had a brset cmd that went a good ways down and it kept saying it was out of range. I finally used AS6811 to get it done.
Had to change the syntax a little.
Bruce sent me a bin that had ashc11 with it so I tried it.
What's MingW & Msys?
Reply
Old Sep 3, 2005 | 09:46 PM
  #13  
junkcltr's Avatar
Supreme Member
iTrader: (1)
 
Joined: Jan 2002
Posts: 4,432
Likes: 1
From: garage
Engine: 3xx ci tubo
Transmission: 4L60E & 4L80E
When I started adding a lot of comments to my AUJP code last year I ended up getting the "out of range" from the compiler. I could remove a line of code and the "out of range" error would go away. A compile using GCC with the MINGW library set cured the problem.

From the MINGW website:
----------------------------------------------------------------------------
MinGW: A collection of freely available and freely distributable Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs.

MSYS: A Minimal SYStem to provide POSIX/Bourne configure scripts the ability to execute and create a Makefile used by make.
-----------------------------------------------------------------------------

Using MSYS allows you to use standard UNIX commands. It works great for any kind of code work. MINGW allows you to write windows applications without having MSVC++ or MS.NET.
You use GCC with the MINGW libraries. GCC has been ported to many platforms and can do cross compiles. You can compile 68HC11 code on a PC. I use GCC for all of my microcontroller apps. My PROM emulator uses a microcontroller and all of the code was written is C and a very small amount of assembly. All compiled with GCC on Windows and it runs on an Atmel 2K EEPROM chip.

Thie MOST IMPORTANT thing is that the source code for GCC, MINGW, MSYS, microcontrollers is FREELY available so you can modify it. That means you can take GCC and change it so it compiled C and assembly into a binary that would run on the GM 68HC11 processor. If you wanted to add new functions to the ECM you could write them in C. It would work well on the 730 ECM since there is a lot of used memory space in the PROM.
Open source code is a good thing. It allows others to learn from it and fix/upgrade it in minimal time. No waiting around for the "code owner" to fix the bugs or add features. Enough rambling.......

J

Last edited by junkcltr; Sep 3, 2005 at 09:50 PM.
Reply
Old Sep 4, 2005 | 03:25 AM
  #14  
Z69's Avatar
Z69
Supreme Member
 
Joined: Sep 2003
Posts: 1,409
Likes: 1
From: Texas
Thanks
I've been waiting for almost a year to find time to start learning C.
AS6811 solves the comment problem.
But the syntax is a little different from the AS assemblers.
But if won't spit out an s19 when done. So you have to go thru another step.
Reply
Old Sep 4, 2005 | 12:36 PM
  #15  
JP86SS's Avatar
Supreme Member
20 Year Member
iTrader: (1)
 
Joined: Apr 2004
Posts: 3,180
Likes: 3
From: Browns Town
Car: 86 Monte SS (730,$8D,G3,AP,4K,S_V4)
Engine: 406 Hyd Roller 236/242
Transmission: 700R4 HomeBrew, 2.4K stall
Axle/Gears: 3:73 Posi, 7.5 Soon to break
The AS6811 is the only one I know how to operate correctly at this point. (just learned from the "dummies thread)
I did have a few issues with out of range addressing but if you look at my AUJP hac it has a few words that the bits are used, they have a "*" in front of the address. This allowed them to be relocated by the assembler and the "out of range" errors went away and all the addresses in the bin lined up perfectly.
I originally removed all of these little stars when I first disassembled the file unknowingly.

Synapsis,
Did the pump go out or the FPR ?
Reply
Old Sep 4, 2005 | 01:27 PM
  #16  
Synapsis's Avatar
Thread Starter
Supreme Member
 
Joined: Dec 2001
Posts: 2,179
Likes: 0
From: Tucson - MdFormula350 = Post uberWhore
Car: Sexy
Engine: Stock
Transmission: Slipping
Oh it was definately the pump. You can hear it screaming in the tank for dear life. The regulator is a brand new Aeromotive with 15 miles on it.
Reply
Old Sep 9, 2005 | 12:10 PM
  #17  
Captain C's Avatar
Member
 
Joined: Aug 2003
Posts: 466
Likes: 0
From: Bakersfield
Car: 1985 IROC-Z
Engine: 1989 350 4 bolt roller block
Transmission: ProBuilt 700R4 Road Race with Edge 9.5" 2800 stall lockup converter
I definately know about those fuel pumps going bad, Just replaced mine....

By writing code, could you perhaps write a program to allow an LT1 computer to run an L98 style TPI? i.e. use the older distributor, larger MAF and perhaps still use a MAP sensor with it?

My car is already plumbed for the addition of a MAP sensor. When I relocated the air inlet temp sensor to the 89 'F' body location I didn't need the port under the plenum to contain a sensor anymore, so I installed a 90* vacuum port and ran a 16" long vacuum line out from under the plenum and plugged it. This way I have it for any future conversions....
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Fronzizzle
Suspension and Chassis
6
Mar 18, 2019 08:29 PM
thefirebirdm@n
South Central Region
3
Sep 14, 2015 01:45 PM
bdads
DIY PROM
3
Aug 24, 2015 06:01 PM
djmarch
Tech / General Engine
3
Aug 19, 2015 12:07 PM
mizz0313
Transmissions and Drivetrain
3
Aug 12, 2015 06:45 AM




All times are GMT -5. The time now is 07:25 AM.