Jump to content

TD5 Speedo Mileage run up circuit


Recommended Posts

@CwazyWabbit

 

I think I found something, Looks like my reader has the MSB/LSB mixed up? Gonna dig into that a bit further...

 

Edit: but now the needle isn't moving. Seems like something went wrong when I started to flash this chip, that might have mixed things up. Maybe I just type over the hex dump below of the working KMH speedometer and see what that does.

 

Edit2: When used my algorithm to generate "666666" and then swapped every first and second byte (so instead of 5D3C 5D3C 5D3C 5D3C 5D3C 5D3D 5D3D 5D3D I typed 3C5D 3C5D 3C5D 3C5D 3C5D 3D5D 3D5D 3D5D ) I got 666667 on my display!!!
 

post-25689-0-78327600-1309731517.jpg

Clipboard01.jpg

Edited by doezel
Link to comment
Share on other sites

16 hours ago, MrKev said:

Can you post a link to your code?

This is the relevant path; you want the complete VisualStudio Project?

        private void tbdesiredODO_changed(object sender, EventArgs e)
        {
            if (int.TryParse(tbDesiredODO.Text, out int desiredODO))
            {
                int odoPart = desiredODO / 16;
                int hexPart = 0xffff - odoPart;
                List<int> hexArray = new List<int>();
                for (int i = 0; i < 8; i++)
                    hexArray.Add(hexPart);
                int remainder = (desiredODO - (odoPart * 16)) / 2;
                for (int i = 0; i < remainder; i++)
                    hexArray--;
                tbHex.Text = "";
                for (int i = 0; i < 8; i++)
                    tbHex.Text += hexArray.ToString("X4") + " ";
                lblStoredODO.Text = ((odoPart * 16) + (remainder * 2)).ToString();
            }
            else
            {
                tbHex.Text = "?";
                lblStoredODO.Text = "?";
            }
        }

Link to comment
Share on other sites

I think I found something;

The first succesful attempt I had in reading the chip gave me this (on another programmer device, an SP200, with this one I wasn't able to write anything back to the chip)
image.png.f8a537e475e305831829a34773e85189.png

But when I change that to 16-bit I get this: (and that looks a bit more familiar)

image.png.16dbbbf81f5924ebbf86030008a5f585.png

So probably it's just the EZP2019 software that's mixing things up.....

Link to comment
Share on other sites

34 minutes ago, doezel said:

@CwazyWabbit

 

SNIP .....

 

Edit2: When used my algorithm to generate "666666" and then swapped every first and second byte (so instead of 5D3C 5D3C 5D3C 5D3C 5D3C 5D3D 5D3D 5D3D I typed 3C5D 3C5D 3C5D 3C5D 3C5D 3D5D 3D5D 3D5D ) I got 666667 on my display!!!

.... SNIP

That is expected, the speedo only stores odd numbered miles. It's impossible to get an even number  :)

EDIT: I may have misinterpreted your exclamation marks as surprise at the odd number when they could be an exclamation of success :)

Link to comment
Share on other sites

Ah yes! I meant indeed that I was happy that the correct anticipated amount of distance appeared on the display. The extra kilometer was already expected.

I am now checking to see if I can get the runup-circuit going again.

 

edit:

Succes!
https://www.youtube.com/watch?v=lNDoYsFZON4

I mixed up Pin 1 & 2 of the pink connector....

Edited by doezel
  • Like 1
Link to comment
Share on other sites

18 hours ago, western said:

Good work takes time & there has been lots of research & effort by those involved Top job all.  :i-m_so_happy:

CW have you had any result with making the Td5 speedo red alarm light work in retrofitted vehicles ? 

The red light is just a matter of putting 12V on pin 6. With my new engine I will use that light as a "Check Engine Light" which I can switch on when an undesired situation appears. But that's something I can do with the Megasquirt installed. Or do you mean something else?

 

 

213.jpg

IMG_1639.jpeg

Link to comment
Share on other sites

On 7/5/2020 at 7:56 PM, western said:

Oh that would be good, my 110 is a 200tdi in a 1989 vehicle with a td5 intrument pack, 

Hey! You mean something like this?
 


I just built the schema that I mentioned above. I didn't use R3 because there's already a resister for the led in the speedo.

pin 6 of the speedo is connected to 12V. 
pin 3 of the speedo is connected to pin 3 of the 555 chip.

When I applied 11V - 12.5V (about the battery voltage when not charging) I got a (about)4-sec flash from the red led of the speedo.

 

Edit: as for the 555chip, I used the ICM7555IPA.
This one has a useable voltage range between 2V and 18V (well within the range of a good battery to a very bad one).
Uses VERY little power; 60 microAmps
Works from -25 to +85 degrees celcius (so when it's not mounted in the engine bay or on the exhaust it should be good).

I think I will place the complete circuit on a little board, seal it up and place it at the back of the speedo. I just need a 12+ when the engine is switched off which I will get from the fuel-relay which is located next to the ECU in my cubby box.

Just make sure you place a little fuse in that 12V line!!!

Here's my power supply; it doesn't even register that the flasher-circuit is connected.
image.thumb.png.0bb64ac938517e1cbb77c95151db2893.png
 

Edited by doezel
  • Like 1
Link to comment
Share on other sites

I would recommend some protection, for example a series resistor in the region of 220 Ohms in line from the supply, followed by a 15V or 18V Zener between the IC supply and ground - this will clamp any transient high voltages caused by wipers etc, to avoid damaging up the timer IC.

  • Like 1
Link to comment
Share on other sites

On 7/5/2020 at 9:35 AM, doezel said:

This is the relevant path; you want the complete VisualStudio Project?

        private void tbdesiredODO_changed(object sender, EventArgs e)
        {
            if (int.TryParse(tbDesiredODO.Text, out int desiredODO))
            {
                int odoPart = desiredODO / 16;
                int hexPart = 0xffff - odoPart;
                List<int> hexArray = new List<int>();
                for (int i = 0; i < 8; i++)
                    hexArray.Add(hexPart);
                int remainder = (desiredODO - (odoPart * 16)) / 2;
                for (int i = 0; i < remainder; i++)
                    hexArray--;
                tbHex.Text = "";
                for (int i = 0; i < 8; i++)
                    tbHex.Text += hexArray.ToString("X4") + " ";
                lblStoredODO.Text = ((odoPart * 16) + (remainder * 2)).ToString();
            }
            else
            {
                tbHex.Text = "?";
                lblStoredODO.Text = "?";
            }
        }

sorry I only just got round to replying.

I would recommend uint (i.e. UInt16) rather than int to avoid complications with sign bits - not likely a problem till lots of miles though!

Otherwise your code seems fine - and I think the problem is probably endianness in the programmer - as I thnk you've already spotted.

I'm sure there must be a way to do this my mathematics rather than loops - but it has been a few years since I last looked, and I've not thought much about it in between.

 

Glad it's of use to people anyway!

Kevin

Link to comment
Share on other sites

On 12/1/2017 at 3:37 PM, TSD said:

I think I finally have a general solution...

                                tmpval = (RATE >> 4) & 0x0003
                                signbit = RATE & 0x1000
                                offset = RATE >> 12
                                
                                if signbit:
                                    checkword = ((((offset - tmpval) * 2) % 😎 + 0x05) << 4
                                else:
                                    checkword = ((((offset + tmpval) * 2) % 😎 + 0x05)  << 4

This could be a general solution in fixed width signed binary, but less obvious in a high level language.

The speedo works over the range RATE = 2000 to 19542, so very possibly out to 32767, buts that's as far as I've tested. It would take another week to check all the values further up and I'm getting bored of the sound of the power relay clicking :rolleyes:

I think I will try to write the R-Pi script and then call it done.

assuming tmpval is "int"

tmpval = (RATE / 16) & 0x8003    // preserving the sign bit, to save the if later on

then no need for the "if" block, just have:

checkword = ((((offset + tmpval) * 2) % 8 + 0x05)  << 4

Edited by MrKev
  • Like 1
Link to comment
Share on other sites

Thanks Kev! 

Rate will be something I will have to fix as soon as I have my engine/gearbox in.

 

Good idea to protect the IC, I'll look into that.

 

as for the uint instead of int; I'll leave it that way, I think it's an INT64 now; that'll be fine.

Link to comment
Share on other sites

  • 1 month later...

Hi, 

I want to adjust my KPH to +3% to change the tires from 7.5R16 to 255/85R16 

So currently I should have a RATE=0x09F4 and Checksum:B3 

the +3% would mean I have to reduce the rate to d2472 or 0x09A8, correct?

I read through all of this thread, but in all honesty I don't get the algorithm you were talking about. So what would be the correct checksum for a rate of 0x9A8?

thx, Franz

Link to comment
Share on other sites

2 hours ago, flechner said:

Hi, 

I want to adjust my KPH to +3% to change the tires from 7.5R16 to 255/85R16 

So currently I should have a RATE=0x09F4 and Checksum:B3 

the +3% would mean I have to reduce the rate to d2472 or 0x09A8, correct?

I read through all of this thread, but in all honesty I don't get the algorithm you were talking about. So what would be the correct checksum for a rate of 0x9A8?

thx, Franz

Is this in a 90 or 110?

I have 110 that has that size tyre. I find the is spot on according to 2 different GPS devices. Have you checked yours yet?

 I think normally a speedometer is intended to under read, so in my case a larger than standard tyre still achieves an accurate reading.

Link to comment
Share on other sites

44 minutes ago, mickeyw said:

Is this in a 90 or 110?

I have 110 that has that size tyre. I find the is spot on according to 2 different GPS devices. Have you checked yours yet?

 I think normally a speedometer is intended to under read, so in my case a larger than standard tyre still achieves an accurate reading.

No, it's a 130 and I checked with a calibrated GPS and the speedometer shows slightly less than the GPS, which is illegal. So I have to do the adjustment 

Link to comment
Share on other sites

46 minutes ago, flechner said:

No, it's a 130 and I checked with a calibrated GPS and the speedometer shows slightly less than the GPS, which is illegal. So I have to do the adjustment 

A 130 and 110 will be the same.

In the UK, a speedometer has to be within a certain percentage of correct, possibly 10% or so. It is normal that manufacturers make the car's speedometer read under rather than above, just to err on the safe side as they are rarely that accurate especially in a Defender.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We use cookies to ensure you get the best experience. By using our website you agree to our Cookie Policy