Optimize a serial protocol between two applications

The Object protocol used in Atmel's touchscreen parts is based on a 64 kB memory address space. At adress zero, there is a small descriptor containing the number of "objects" (among other things). Then there is an object descriptor table describing start address, size and type. If you do not recognize an object type you ignore it.

The firmware can thus change base addresses, and you can add more functionality, sometimes without updating the other end.

BR Ulf Samuelsson

Reply to
Ulf Samuelsson
Loading thread data ...

If you want backward compatible, you have to work as you do now, using a slave answer version, and decision trees (if statements...)

However, you can simplify future version creep, if you can make newer slaves more message tolerant. eg they ignore messages or params they do not understand, _and_ also do not lose sync while doing so.

To enable slaves not lose sync, some length param is often included on longer messages. Then you need test only for (Version >= SmarterSlave), and your decision tree can stop growing a little ;)

-jg

Reply to
j.m.granville

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.