That's a great idea. Pulse widths I have measured are like 10, 0E, 3E,3F etc. So I guess 'nearest' would be perhaps (+/- 2) and the decoders would have a tolerance range. I will experiment to see how far out a pulse width can actually be. Thanks Justin ----- Original Message ----- From: "Bob Ammerman" To: > Find the 'nearest' value in the dictionary. If there is an entry 'close' to > this value then: > > Modify the dictionary entry to be ( 3 * dict_entry + new_value) / 4. > This step will hopefully help the dictionary entry be closer to > the exact correct time. > > otherwise allocate an unused dictionary entry and store this time in it. > > 4. Record the three-bit index (0..15) of the dictionary entry that was found ...er, that is 'four-bit index', not 'three-bit index' -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads