K8055 DeBounce Time

Hi all

This sort of follows on from another thread but it’s just for confirmation.

MostlyHarmless kindly sent me to the following link http://www.rhinoman.org/K8055/K8055_Upgrade.htm for information in regards the HID data. (Much appreciated by the way).

Any how looking at the page re debounce times there is a table provided and the Vellemen equation of:

round(0.92.4541POWER((Time in ms),0.5328))

I’ve converted the code for Objective-c but the higher times on the linked chart are out with my calculations e.g. 7468 gives 256 not 255. Have a look below and could some confirm if this is correct for setting the element value.

[code]

    int debounceTimeMs = 4340;
    
    int elementValue = round(0.9*2.4541*pow(debounceTimeMs,0.5328));
    
    NSLog(@"Debounce time element value = %d", elementValue);
    [/code]

The above results in a element value or command value of (192).

More important as the default debounce is 2ms this would be a element value of 3?

Thanks
Steve

There are a lot of speculations on the internet about how the K8055 debounce time relates to the value used in the debounce command message. Mine are probably no better than any other.

The equation “round(0.9 * 2.4541 * POWER(ms, 0.5328))” was taken from the K8055D.DLL Pascal source code, which has kindly been provided by Velleman in this thread: viewtopic.php?f=3&t=7405

Due to copyright reasons, Velleman has not been able to share what algorithm the original K8055 firmware actually uses to convert that 0…255 command value back into milliseconds. It is my belief that the algorithm inside the firmware is something relatively simple using bit shift and add operations, and that the above equation is an attempt to represent a reverse algorithm for that. But as I don’t have access to the original firmware code, it is impossible to be sure.

The replacement firmware, James Holland and I are currently developing for K8055 cards converted to PIC18F2550 microcontrollers, could later on have a protocol extension that allows to specify the debounce value with a full 16 bit precision.

Regards, Jan

Thanks for the help.

Do I take it that like the counters the debounce times are reset to default when the board is power down / removed?

Cheers