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

New to source code editing

Thread Tools
 
Search this Thread
 
Old May 17, 2016 | 03:54 PM
  #51  
Vanilla Ice's Avatar
Supreme Member
20 Year Member
 
Joined: Aug 2002
Posts: 1,170
Likes: 42
From: ARIZONA
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

As far as a timer/counter...
Here's mine:
https://github.com/kerchakone/MerpMo...erpMod/Timer.c
May not work too great on this old CPU but the idea is there.
It's really simple. Need to find out how many cycles per second the CPU runs your code at. For this code I wrote it was about 15000 per second.
Then everytime the code is run it counts down 1. So you set the highest value you need and it counts down to 0. When it gets there execute what you need.
Again, this ECM had PLENTY of ram and was 32 bit so the code worked easily, but will need to be worked for these old cars.

You'll need at least 2 bytes of ram for a counter. And possibly another bit or two for execution flag and start flag.

Last edited by Vanilla Ice; May 17, 2016 at 03:59 PM.
Reply
Old May 19, 2016 | 10:15 AM
  #52  
camaroyoungster's Avatar
Thread Starter
Member
10 Year Member
 
Joined: Aug 2011
Posts: 280
Likes: 5
From: Wisconsin
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Could I just make it where it then jumps from a point to check if the knock counts are lower than the threshold and then turn the light off? Or would that cause the program to infinitely loop with checking if it is higher and checking if it is lower?
Reply
Old May 19, 2016 | 01:27 PM
  #53  
Vanilla Ice's Avatar
Supreme Member
20 Year Member
 
Joined: Aug 2002
Posts: 1,170
Likes: 42
From: ARIZONA
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

Originally Posted by camaroyoungster
Could I just make it where it then jumps from a point to check if the knock counts are lower than the threshold and then turn the light off? Or would that cause the program to infinitely loop with checking if it is higher and checking if it is lower?
The subroutine needs to have a checking system to look at how the light is behaving before it attempts to alter it. Or the hook for your code needs to be inside the routine to turn on the knock light itself OR BOTH.

You also keep saying knock counts. Please use knock retard instead. It will make your coding infinitely easier. I speak from experience. I don't know if you missed it or youre just typing counts still but meaning degrees, but use degrees of retard.

As far as looping, you MUST walk through the code you're writing to make sure there are no bugs or "loops." Take a value and go through the code to see where it ends up. Then take another value and do the same. You should be able to see every way it walks through and where it ends up. This is how you avoid loops and errors.

I found that in order to write in Antilag how I wanted there was a massive amount of coding I had to add in to keep it working correctly. I never went back to streamline it and it may have been done, but the original code is quite long.
Reply
Old Jun 1, 2016 | 08:45 AM
  #54  
camaroyoungster's Avatar
Thread Starter
Member
10 Year Member
 
Joined: Aug 2011
Posts: 280
Likes: 5
From: Wisconsin
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Ok sorry for using knock counts, That's how it was mentioned in the program. Anyways, since school is done Ill have much more time to work on this. And do you know how exactly fast the program runs all of this? I guess I just need a perspective view to understand things correctly. I was just wondering because if I put this at the end of the program how long it would actually take to start reading it. This is because I don't know if the program just reads down onto the next line if there are no jumps or interrupts?
Reply
Old Jun 1, 2016 | 08:53 AM
  #55  
camaroyoungster's Avatar
Thread Starter
Member
10 Year Member
 
Joined: Aug 2011
Posts: 280
Likes: 5
From: Wisconsin
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

I feel like it is pretty straight forward in terms of just copying the same code but to turn it off if it is lower than the knock retard threshold. But I also feel like after the first time it runs to check if it is higher it should run the whole program again and then check to see if it is lower.

Code:
LF60B:        ldab *L00A2        ;load knock counts to acumulator b
        cmpb 8EE5        ;compare knock retard to knock threshold
        bhi LF60C        ;branch if hi to 
LF60C:        clrb
        jsr LF60D
LF60D:        bset *L0038,#0x01    ;turn on check engine light    
LF60E:        ldab *L00A2        ;load knock counts to acumulator b
        cmpb 8EE5        ;compare knock retard to knock threshold
        bhi LF60F        ;branch if low to 
LF60F:        clrb
        jsr LF610
LF610:        bset *L0038,#0x00    ;turn off check engine light
I guess now would be a good time to start learning how to actually make it jump from the middle of the "stock" code to my "patch area".

To do this I am assuming I need to find all the points where the "knock retard" value is loaded in and then after where it completes that portion jumps to my "patch" and executes the first part?
Reply
Old Jun 1, 2016 | 11:40 AM
  #56  
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
Re: New to source code editing

Suggestion,
Don't use CEL for the indication (It will scare you the first time it turns on a WOT)

Find an open output and wire up an LED to it.

Use 1 RAM address,
If Knock retard >0 then increment up by 1.
If Knock Retard=0 then decrement by 1.
If RAM >0 = turn on light, RAM = 0, turn off light.

or use no RAM,
if Knock Retard >0, turn on the light.
if Knock Retard = 0, Turn off the light.
That option will give no residual delay of the light turning off.

Gets rid of any CEL/SES light conflicts in the code.
Reply
Old Jun 1, 2016 | 12:04 PM
  #57  
Vanilla Ice's Avatar
Supreme Member
20 Year Member
 
Joined: Aug 2002
Posts: 1,170
Likes: 42
From: ARIZONA
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

Originally Posted by JP86SS
Suggestion,
Don't use CEL for the indication (It will scare you the first time it turns on a WOT)
That's the whole point to me but I wouldn't put the threshold at zero. Make it a value that's unacceptable to be above.
Reply
Old Jun 3, 2016 | 12:53 PM
  #58  
camaroyoungster's Avatar
Thread Starter
Member
10 Year Member
 
Joined: Aug 2011
Posts: 280
Likes: 5
From: Wisconsin
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

But i was told that there are not too many outputs you can use on the 7730 ecm. That is why I would use the CEL. And this isnt neccsarily to be totally practical. Its just so can learn some of the ins and outs of the ecm for future tuning use.

Drew
Reply
Old Jun 19, 2016 | 07:35 PM
  #59  
camaroyoungster's Avatar
Thread Starter
Member
10 Year Member
 
Joined: Aug 2011
Posts: 280
Likes: 5
From: Wisconsin
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Ok so now does someone want to help be put this bit of code into a bin file?

Drew
Reply
Old Jul 3, 2016 | 03:19 PM
  #60  
Vanilla Ice's Avatar
Supreme Member
20 Year Member
 
Joined: Aug 2002
Posts: 1,170
Likes: 42
From: ARIZONA
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

You ever get this going?
Here you can see how I started this venture:
https://www.thirdgen.org/forums/powe...ml#post6055449
Maybe you'd like to take my setup idea and make it better so I don't have to.
Reply
Old Jul 3, 2016 | 08:28 PM
  #61  
camaroyoungster's Avatar
Thread Starter
Member
10 Year Member
 
Joined: Aug 2011
Posts: 280
Likes: 5
From: Wisconsin
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

I haven't gotten it going yet. I still need to figure out how to put a patch in a bin.
Reply
Old Jul 3, 2016 | 08:49 PM
  #62  
Vanilla Ice's Avatar
Supreme Member
20 Year Member
 
Joined: Aug 2002
Posts: 1,170
Likes: 42
From: ARIZONA
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

How or where are you writing this patch?
If you're writing in hex just use a hex editor to edit the bin directly.


Right now I alter the Ida file and produce a dif file then use idapatcher.c to patch the bin.
Reply
Old Jul 3, 2016 | 09:00 PM
  #63  
camaroyoungster's Avatar
Thread Starter
Member
10 Year Member
 
Joined: Aug 2011
Posts: 280
Likes: 5
From: Wisconsin
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

I was just modifying the text file to see what worked. I haven't done anything with assembling it back.
Reply
Old Jul 4, 2016 | 09:47 AM
  #64  
RBob's Avatar
Moderator
iTrader: (1)
 
Joined: Mar 2002
Posts: 18,432
Likes: 233
From: Chasing Electrons
Car: check
Engine: check
Transmission: check
Re: New to source code editing

Originally Posted by camaroyoungster
I haven't gotten it going yet. I still need to figure out how to put a patch in a bin.
https://www.thirdgen.org/forums/diy-...thod-demo.html

RBob.
Reply
Old Jul 4, 2016 | 03:03 PM
  #65  
camaroyoungster's Avatar
Thread Starter
Member
10 Year Member
 
Joined: Aug 2011
Posts: 280
Likes: 5
From: Wisconsin
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

I read through that whole thing twice and I can't seem to get the assembler to work. I don't know if it is because I have windows 10 or not.
Reply
Old Jul 4, 2016 | 03:28 PM
  #66  
Vanilla Ice's Avatar
Supreme Member
20 Year Member
 
Joined: Aug 2002
Posts: 1,170
Likes: 42
From: ARIZONA
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

Originally Posted by Vanilla Ice
just use a hex editor to edit the bin directly.
Good, SIMPLE advice.
Reply
Old Jul 4, 2016 | 03:38 PM
  #67  
camaroyoungster's Avatar
Thread Starter
Member
10 Year Member
 
Joined: Aug 2011
Posts: 280
Likes: 5
From: Wisconsin
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

I have read the write up using tuner pro: https://www.thirdgen.org/forums/diy-...-tunerpro.html
but there were some steps that jumped to another without very much explanation.
Reply
Old Jul 4, 2016 | 03:44 PM
  #68  
Vanilla Ice's Avatar
Supreme Member
20 Year Member
 
Joined: Aug 2002
Posts: 1,170
Likes: 42
From: ARIZONA
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

Originally Posted by camaroyoungster
I have read the write up using tuner pro: https://www.thirdgen.org/forums/diy-...-tunerpro.html
but there were some steps that jumped to another without very much explanation.
In order to get an answer you've got to ask a question.
Reply
Old Jul 4, 2016 | 04:30 PM
  #69  
camaroyoungster's Avatar
Thread Starter
Member
10 Year Member
 
Joined: Aug 2011
Posts: 280
Likes: 5
From: Wisconsin
Car: 1985 Camaro Sport Coupe
Engine: Chevy 3.1
Transmission: 700r4
Re: New to source code editing

Haha Yeah I guess. Would using tunerpro to change the hex file work though? Is that what you would use?
Reply
Old Jul 5, 2016 | 10:05 AM
  #70  
Vanilla Ice's Avatar
Supreme Member
20 Year Member
 
Joined: Aug 2002
Posts: 1,170
Likes: 42
From: ARIZONA
Car: 92 Trans Am Conv
Engine: LB9
Transmission: T5
Axle/Gears: 3.08
Re: New to source code editing

Originally Posted by camaroyoungster
Haha Yeah I guess. Would using tunerpro to change the hex file work though? Is that what you would use?
Yes that's exactly what it does.
No I probably wouldn't because there are easier ways for ME to do it.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
AmpleUnicorn88
South West Region
28
May 22, 2017 12:47 PM
yevgenievich
Engine/Drivetrain/Suspension Parts for Sale
7
Jul 18, 2016 07:47 AM
85@IRocZ
Interior Parts for Sale
41
May 22, 2016 07:41 AM
85@IRocZ
Engine/Drivetrain/Suspension Parts for Sale
21
May 17, 2016 08:03 PM
FrankieRider2
History / Originality
15
Apr 28, 2016 04:37 PM




All times are GMT -5. The time now is 11:19 PM.