Modbus

Modbus

Function Pointers in PIC Assembler

Simplified the Modbus slave code by replacing the large case statements—sprinkled throughout—with function pointer tables. Compared to computed jump tables, they may seem heavyweight, but they have four significant advantages:

  • They allow arbitrary case identifiers—no need to be sequential (or even numeric!),
  • They aren't limited to 256 cases,
  • They greatly simplify the code, even reducing its size (the overhead is amortized quickly), and
  • They may be daisy-chained, allowing derivation and polymorphism.

Real Code

Stashed the real code in the repository. I guess it's a real project, since only throw-away tests avoid revision control. Nice to have (secure) remote access, too. That was about to get inconvenient.

Modbus Kickoff

Set up the subversion repository and seeded it with some placeholder files, just to get the hang of things. Went to a lot of effort to get permissions and SSL working correctly, since I'm still not sure how I will eventually license the project.

Syndicate content