CwazyWabbit Posted July 4, 2020 Share Posted July 4, 2020 That kinda dropped off my radar Ralph, sorry. Quote Link to comment Share on other sites More sharing options...
western Posted July 4, 2020 Share Posted July 4, 2020 no problems would still be interested in a magic box to make it work. Quote Link to comment Share on other sites More sharing options...
doezel Posted July 5, 2020 Share Posted July 5, 2020 (edited) @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!!! Edited July 5, 2020 by doezel Quote Link to comment Share on other sites More sharing options...
doezel Posted July 5, 2020 Share Posted July 5, 2020 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 = "?"; } } Quote Link to comment Share on other sites More sharing options...
doezel Posted July 5, 2020 Share Posted July 5, 2020 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) But when I change that to 16-bit I get this: (and that looks a bit more familiar) So probably it's just the EZP2019 software that's mixing things up..... Quote Link to comment Share on other sites More sharing options...
CwazyWabbit Posted July 5, 2020 Share Posted July 5, 2020 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 Quote Link to comment Share on other sites More sharing options...
doezel Posted July 5, 2020 Share Posted July 5, 2020 (edited) 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 July 5, 2020 by doezel 1 Quote Link to comment Share on other sites More sharing options...
doezel Posted July 5, 2020 Share Posted July 5, 2020 18 hours ago, western said: Good work takes time & there has been lots of research & effort by those involved Top job all. 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? Quote Link to comment Share on other sites More sharing options...
western Posted July 5, 2020 Share Posted July 5, 2020 I want it to flash as a deterent like it would in a td5 Quote Link to comment Share on other sites More sharing options...
doezel Posted July 5, 2020 Share Posted July 5, 2020 (edited) Ah yes, good idea. I’ll try to find a standalone little module to send 12v pulses when the engine is off. i think it would be something around a 555 timer. 555’s seem to run at 12v fine. https://www.electronicshub.org/dummy-alarm-circuit/ Edited July 5, 2020 by doezel Quote Link to comment Share on other sites More sharing options...
western Posted July 5, 2020 Share Posted July 5, 2020 We have tried a similar kit that Maplin used to do but couldn't get it to work with the speedo red led, https://forums.lr4x4.com/topic/103854-retrofitted-td5-speedo-alarm-red-led/ Quote Link to comment Share on other sites More sharing options...
doezel Posted July 5, 2020 Share Posted July 5, 2020 (edited) I will build this one to check:http://www.555-timer-circuits.com/dummy-alarm.html parts will cost me €2,62 for 1 set (times 2, and €6,95 make €12,19 🙂 ) I will run it from the fuel-relay when it's switched off. So it will always run when the engine isn't running. Edited July 5, 2020 by doezel Quote Link to comment Share on other sites More sharing options...
western Posted July 5, 2020 Share Posted July 5, 2020 Oh that would be good, my 110 is a 200tdi in a 1989 vehicle with a td5 intrument pack, Quote Link to comment Share on other sites More sharing options...
doezel Posted July 7, 2020 Share Posted July 7, 2020 Just received a set of pink connectors for my speedo. Hope I can install them soon (within a month) together with my "new" engine.... 2 Quote Link to comment Share on other sites More sharing options...
doezel Posted July 9, 2020 Share Posted July 9, 2020 (edited) 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. Edited July 9, 2020 by doezel 1 Quote Link to comment Share on other sites More sharing options...
western Posted July 9, 2020 Share Posted July 9, 2020 Yes but not with the speedo showing 200kph or mph equivalent, rather have it when vehicle is parked & switched off. 1 Quote Link to comment Share on other sites More sharing options...
doezel Posted July 9, 2020 Share Posted July 9, 2020 Needle and led aren't connected. The speed you see was on it when I pulled the power. Quote Link to comment Share on other sites More sharing options...
MrKev Posted July 9, 2020 Share Posted July 9, 2020 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. 1 Quote Link to comment Share on other sites More sharing options...
MrKev Posted July 9, 2020 Share Posted July 9, 2020 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 Quote Link to comment Share on other sites More sharing options...
MrKev Posted July 9, 2020 Share Posted July 9, 2020 (edited) 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 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 July 9, 2020 by MrKev 1 Quote Link to comment Share on other sites More sharing options...
doezel Posted July 9, 2020 Share Posted July 9, 2020 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. Quote Link to comment Share on other sites More sharing options...
flechner Posted August 31, 2020 Share Posted August 31, 2020 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 Quote Link to comment Share on other sites More sharing options...
mickeyw Posted August 31, 2020 Share Posted August 31, 2020 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. Quote Link to comment Share on other sites More sharing options...
flechner Posted August 31, 2020 Share Posted August 31, 2020 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 Quote Link to comment Share on other sites More sharing options...
mickeyw Posted August 31, 2020 Share Posted August 31, 2020 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.