On June 4, 2007 at 22:08, bjdraw said...
Alan,
I would have never figured out the checksums if it wasn't
for your post.
Thank you very much!
Now my HA system can control my TV and I learned a little
HEX along the way.
To think of the bad reputation I have here, especially among DIYs, and how well earned it is.
The most important lesson is that everything is binary. All other numerical representations are merely used for convenience. The odds of transposing a 1 or a 0 were we to regularly use binary is too great. It is also too hard to read. So for convenience we use other numeric formats, in this case base16 but you could substitute any other, base10, base8 as ultimately it's all base2. Never expect to see a string in a terminal emulation program as you sent it. That program was coded by a programmer and in all likelihood it is biased to display binary first as ASCII and if no printable character is found then as hex. This can be done as the values the processor is seeing are in fact base2 or binary and the emulation program has been coded to translate those values into readable form. This was the single most important insight in my own journey into understanding serial protocols.
What you will find is that serial has its own language. The more you use it the more familiar you will be with it. Check sums are somewhat vestigial. Most protocols don't use them even though they should. Its purpose is to make certain the string values received are valid and not in any way corrupted. A smart programmer will write a function that will calculate the checksum in run time but a less skilled programmer or one working with processor or GUI programming limitations can do what you did and use the scientific calculator in Windows.
Don't spread the word too loudly or over widely or Ernie is apt to harangue me on my spelling again.
Alan