added another TDI to the family

gmenounos

Vendor
Joined
Jun 26, 2003
Location
Watertown, MA, USA
TDI
'99.5 Golf GLS, '01 Jetta GLX Wagon (TDI conversion)
Congrats!

I find that number odd. It takes 20 bits to store 1 million km, but 20 '1' bits is 1,048,575 km or 651,554 miles

Maybe @gmenounos can enlighten us as to how the cluster stores the value.
The cluster actually uses effectively 19 bits to store the odometer value in the EEPROM. That allows it to count from 0 to 524,287, so to be able to record a million km, it counts in increments of 2km. But if you switch the odometer to km, you'll see it display both even and odd km values. So how does it do that? It cheats by keeping track of the extra km in cluster RAM, which works fine as long as the battery isn't disconnected. You can verify this by disconnecting the battery when the odometer is displaying an odd number of kilometers. When you reconnect it, it will show an even number of km.

So why can't it count up to 1,048,575 km? Because the cluster is programmed to only count up to 999,999 km (probably because there are only 6 digits in the display). So it should be able to display up to (999999 / 1.609344 = 621370) miles, except that it uses a slightly inaccurate conversion factor of 1.609375 (which I think makes the binary math easier for the cluster software because 1.609375 = 103/64).

And 999999 / 1.609375 = 621358
 

gmenounos

Vendor
Joined
Jun 26, 2003
Location
Watertown, MA, USA
TDI
'99.5 Golf GLS, '01 Jetta GLX Wagon (TDI conversion)
And why 19 bits to store the odometer value in the EEPROM? It's actually stored in 16 bytes (128 bits) but it uses a weird format (I think for redundancy in case a little bit of the EEPROM gets corrupted and to reduce the number of times each EEPROM location needs to be written (EEPROM cells wear out after a certain number of writes)).

The odometer is stored in 8 consecutive blocks of 2 bytes each. Each block is initialized at the factory to FFFF (65535). After the car travels the first 2 km, the first block is decremented by 1. After the second 2km, the second block is decremented by 1. And so on, up to block 8. Then it goes back to block 1.

ffff ffff ffff ffff ffff ffff ffff ffff (0 km)
fffe ffff ffff ffff ffff ffff ffff ffff (2 km)
fffe fffe ffff ffff ffff ffff ffff ffff (4 km)
fffe fffe fffe ffff ffff ffff ffff ffff (6 km)
fffe fffe fffe fffe ffff ffff ffff ffff (8 km)
fffe fffe fffe fffe fffe ffff ffff ffff (10 km)
fffe fffe fffe fffe fffe fffe ffff ffff (12 km)
fffe fffe fffe fffe fffe fffe fffe ffff (14 km)
fffe fffe fffe fffe fffe fffe fffe fffe (16 km)
fffd fffe fffe fffe fffe fffe fffe fffe (18 km)
fffd fffd fffe fffe fffe fffe fffe fffe (20 km)

etc.

So every 2km you drive, on average one of 16 locations in the EEPROM needs to written. This reduces the number of times any one location needs to be written and makes it obvious if any location gets accidentally corrupted.

And so even though there are 128 bits reserved for the odometer, each byte pair can store 2^16 (65536) values and only changes every 8 (2^3) times. 16 + 3 = 19.

And all of the above info only applies to the MKIV VDO clusters that I've studied. The Bosch and Marelli clusters are likely very different.
 
Top