understanding a 16 bit number stored high and low

I'm needing to change the repeat rate of key presses, but don't understand these values. Here's what it says in the data sheet:

10.14. Repeat
This is a 16 bit number stored high and low (see trigger). The actual value is found by trial and error. When a pad is touched the value is immediately recorded, if the finger is held there another, same value is recorded until the pad is untouched.
The time delay between each key record is determined by this value. The default value of 1256 (0x4e8) gives about 1/2 second.

and this photo shows the EERPOM table where the values are stored in slot 24 & 25. When I read these values from EERPOM, I get 10 & 196. I could experiment with changing these numbers, but I'd really like to understand how it works.
I would like to (1) know what values to make it have a very long repeat rate (like 4+ seconds), & (2) I'd really like to understand how it works - saving a number in two separate parts.

If I can understand it, then I should be able to come up with the value.
Thanks.

SouthernAtHeart:
I'm needing to change the repeat rate of key presses, but don't understand these values. Here's what it says in the data sheet: and this photo shows the EERPOM table where the values are stored in slot 24 & 25. When I read these values from EERPOM, I get 10 & 196. I could experiment with changing these numbers, but I'd really like to understand how it works.
I would like to (1) know what values to make it have a very long repeat rate (like 4+ seconds), & (2) I'd really like to understand how it works - saving a number in two separate parts.

If I can understand it, then I should be able to come up with the value.
Thanks.

( High Byte x 256 ) + Low Byte = 16 Bit Value

( 10 * 256 ) + 196 = 2,756

It's the high & low bytes of a binary (base-2) value... It's tricky because it's NOT the high & low digits of a regular decimal number. It's "easier" in hexadecimal because every group of 4-bytes converts exactly to one hex digit.

That means you have to convert the two bytes to their hex values (if you read them as normal decimal variables). Then combine the high & low bytes hex values together to make one hex number, and convert that to one decimal value. (Or do the reverse if you want to write a number into memory.)

Fire-up the Windows Calculator and switch it to Programmer View.

The default value of 1256 (0x4e8) gives about 1/2 second.

If you convert 1256 to hexadecimal you get 04E8 (hex). The high (most significant) byte contains 4 (which is the same in hex or decimal) and the low (least significant) byte contains E8, which is 232 (decimal).

Of course, it's really stored in binary which means
High byte = 0100 (binary) = 04 (hex) = 04 (decimal).
Low byte = 1110 1000 (binary) = E8 (hex) = 232 (decimal).

If you read those two bytes as regular decimal numbers, you'll get 04 and 232, and those two bytes represent 1256.

If you could read it as a regular 16-bit variable the computer/microcontroller/software will read it correctly as 1256. It only gets tricky when you read the bytes one at a time.

You don't need to worry about the binary, but that's to help you understand what's going on (or to further confuse you! :wink: ).

and this photo shows the EERPOM table where the values are stored in slot 24 & 25. When I read these values from EERPOM, I get 10 & 196.

OK...

10 (decimal) = A (hex)
196 (decimal) = C4 (hex)

So, the "real number" is: AC4 (hex) or 2,756 (decimal).