Are you trying to store macros that are triggered by unit addresses? You can take one of two approaches. The first stores an index table at the beginning of EEPROM with pointers to macros and a length byte. The macros are stored after the index table. The second merely stores them individually, which means you have duplicate entries for the unit addresses. It depends on how much EEPROM you have and on the complexity of the macros. The first makes more efficient use of the EEPROM while the latter is easier to implement but wastes some space as records must all be the same size.
I used the former method to store X-10 macros but am using the latter with a device that will translate between several different protocols. In each case I have an external EEPROM rather than just the internal EEPROM of the PIC so efficient use of the available space is not a major factor.
The latter allows for multiple events with the same trigger but with differing ON/OFF times depending on the day of the week. (I use one byte for the 7 days plus a bit left over.)
Bookmarks