Looking for help with TunerPro definition editor...
Thread Starter
Senior Member
Joined: Jul 2002
Posts: 815
Likes: 0
From: Toledo, OH
Car: '87 Formula
Engine: 350
Transmission: Auto
Looking for help with TunerPro definition editor...
I'm having some trouble understanding this here. Using a '727, and the ald definition file A115. I am going through and checking everything (well, more so to learn from it than actually looking for errors) but there is one thing I wanted to check and that was Spark Advance Relative to TDC. While datalogging this weekend on my first startup, I was getting a reading of 84-89* for this which doesn't sound right at all. So I'm looking at the definition file and it doesn't seem like it is right either.
From A115:
39 SAP TOTAL UNLIMITED SPARK ADV. REL TO TDC (MSB)
40 SAP + 1 TOTAL UNLIMITED SPARK ADV. REL TO TDC (LSB)
Double byte value in 2's complement representation
If Bit 7 of MSB = 0 then result is positive
value = ([N39]*256 + [N40])
If Bit 7 of MSB = 1 then result is negative
value = 65536 - ([N39]*256 + [N40])
DEGREES = value * 90/256
Now in TunerPro, it defines SARTDC as byte 39, 16 bit which would include bytes 39 and 40 to make one word. How does TunerPro go about calculating the value of SARTDC then if given the above. The operation it uses in my definition file is 'Multiply([X*Factor] + Offset)' , factor .351563, offset 0. I'm not seeing how this relates to the way it is defined to be calculated by A115.
Thanks,
Ben
From A115:
39 SAP TOTAL UNLIMITED SPARK ADV. REL TO TDC (MSB)
40 SAP + 1 TOTAL UNLIMITED SPARK ADV. REL TO TDC (LSB)
Double byte value in 2's complement representation
If Bit 7 of MSB = 0 then result is positive
value = ([N39]*256 + [N40])
If Bit 7 of MSB = 1 then result is negative
value = 65536 - ([N39]*256 + [N40])
DEGREES = value * 90/256
Now in TunerPro, it defines SARTDC as byte 39, 16 bit which would include bytes 39 and 40 to make one word. How does TunerPro go about calculating the value of SARTDC then if given the above. The operation it uses in my definition file is 'Multiply([X*Factor] + Offset)' , factor .351563, offset 0. I'm not seeing how this relates to the way it is defined to be calculated by A115.
Thanks,
Ben
Moderator
iTrader: (1)
Joined: Mar 2002
Posts: 18,432
Likes: 233
From: Chasing Electrons
Car: check
Engine: check
Transmission: check
Double byte value in 2's complement representation
If Bit 7 of MSB = 0 then result is positive
value = ([N39]*256 + [N40])
If Bit 7 of MSB = 1 then result is negative
value = 65536 - ([N39]*256 + [N40])
DEGREES = value * 90/256
If Bit 7 of MSB = 0 then result is positive
value = ([N39]*256 + [N40])
If Bit 7 of MSB = 1 then result is negative
value = 65536 - ([N39]*256 + [N40])
DEGREES = value * 90/256
The two bytes need to be combined: take the first byte and multiply it by 256 and add the second byte to it (([N39]*256 + [N40])). The N39 and N40 are the byte numbers in the ALDL stream. Now if the MSB was a 1 then need to do the 2's complement conversion: value = 65536 - ([N39]*256 + [N40]), else it is OK the way it is.
Once they are combined (and maybe sign converted) that value needs to be factored by 0.352 (DEGREES = value * 90/256). The result is SA in degrees.
One item that needs to be noted is the term MSB. This can also mean Most Significant Byte. The proper method is to use a lower case b for bit (MSb) and an upper case B for byte (MSB).
RBob.
Thread Starter
Senior Member
Joined: Jul 2002
Posts: 815
Likes: 0
From: Toledo, OH
Car: '87 Formula
Engine: 350
Transmission: Auto
RBob,
I thought you might be the first to respond to this, seems like you've been helping me out a lot lately. However, I maybe should have been more clear in what I was asking. I see how the formula works, from the A115 definition. What I'm not seeing is how to do that operation(s) in TunerPro. For example, for the '730 definition file in TunerPro definition editor, it can be seen that for Spark Advance Relative to TDC the parameters are:
Byte Number 39
Mode 1
16 bit
Multiply([X*Factor] + Offset)
Factor 0.351563
Offset 0.000000
Degrees..yada yada
So, the factor .351563 is the 90/256 of the equation. So in the definition editor, it is multiplying the 16-bit word consisting of both bytes N39 and N40. Where is the multiplication of byte N39 by 256 before adding it to N40? Also, where is the comparison check of bit 7 to determine if it should be negative, and if so, where is that corresponding formula in TunerPro def. editor? Again, all I see is the multiplication of the word consisting of byte N39 and N40 by .351563 (or 90/256). See what I'm saying? Am I being thick-headed here and missing something obvious? I have a feeling I may need a slap to the head for this one once I figure it out.
I thought you might be the first to respond to this, seems like you've been helping me out a lot lately. However, I maybe should have been more clear in what I was asking. I see how the formula works, from the A115 definition. What I'm not seeing is how to do that operation(s) in TunerPro. For example, for the '730 definition file in TunerPro definition editor, it can be seen that for Spark Advance Relative to TDC the parameters are:
Byte Number 39
Mode 1
16 bit
Multiply([X*Factor] + Offset)
Factor 0.351563
Offset 0.000000
Degrees..yada yada
So, the factor .351563 is the 90/256 of the equation. So in the definition editor, it is multiplying the 16-bit word consisting of both bytes N39 and N40. Where is the multiplication of byte N39 by 256 before adding it to N40? Also, where is the comparison check of bit 7 to determine if it should be negative, and if so, where is that corresponding formula in TunerPro def. editor? Again, all I see is the multiplication of the word consisting of byte N39 and N40 by .351563 (or 90/256). See what I'm saying? Am I being thick-headed here and missing something obvious? I have a feeling I may need a slap to the head for this one once I figure it out.
Moderator
iTrader: (1)
Joined: Mar 2002
Posts: 18,432
Likes: 233
From: Chasing Electrons
Car: check
Engine: check
Transmission: check
Ah, I missed the question 
There is a good possibility that the checking of the MSB isn't supported (in TunerPro). Not uncommon and may be one of the reasons Mark is developing new formats for this stuff.
The multiply of 256 of N39 should be inherent. This is because of the value being defined as 16-bit.
RBob.

There is a good possibility that the checking of the MSB isn't supported (in TunerPro). Not uncommon and may be one of the reasons Mark is developing new formats for this stuff.
The multiply of 256 of N39 should be inherent. This is because of the value being defined as 16-bit.
RBob.
Thread Starter
Senior Member
Joined: Jul 2002
Posts: 815
Likes: 0
From: Toledo, OH
Car: '87 Formula
Engine: 350
Transmission: Auto
I see. I pretty much figured the bit 7/positive value had to be assumed since the majority of the time it would be positive and it didn't seem like it supported it, at least anywhere I've seen in the editor. The N39*256 before adding to N40 was what was really getting me. It's been a while since I've taken any classes using binary numbers so I'm a little rusty, perhaps, with binary math.
Speaking of TunerPro, when is Mark supposed to be releasing TP4.0, I thought I read a while ago he hoped to have it out beginning of this year, as in January. I've been anxiously awaiting it, can't wait to try it out.
Speaking of TunerPro, when is Mark supposed to be releasing TP4.0, I thought I read a while ago he hoped to have it out beginning of this year, as in January. I've been anxiously awaiting it, can't wait to try it out.
Thread
Thread Starter
Forum
Replies
Last Post





