heat control  r71
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
features & changes

15.11.2014 interval driven temperature sending

Since we are not allowed (and didn't like) any more to continuously send the temperatures we are encouraged to think about an interval driven solution. For this we need to come up with the following preconditions as changes (hc.c):

the sender's datasheet

If we attentively read it, we can find the clause:

CEPT 70-03 Recommendation
In order to comply with such rule, the device must be used only for a 10% of an hourly duty-cycle, (that means 6 minutes of utilisation over 60).

Note: We are doing good, if we comply to this recommendation.

on the hc box side

  • DoControl must check by its own, whether the temperature values are valid. It must have a chance to get called whenever possible so that it can do its control job after value capturing
  • the structure MEASSET g_sets is not initialized @ startup but in DoControl one of the first checks accesses the outTemp component. This leads to undefined control state right after startup when no temperature is being captured before the check. This needs to be changed

on the sender side

  • the timer interrupt (in compare match mode) must be enabled to realize the intervals
  • the match value must be set accordingly - dependent on interval time
  • a match counter must track the matches to get the interval time span, then fire the interval on threshold
  • a semaphore gate must signal the main task when sending is allowed and itself must close the gate after sending is done
  • the mentioned gate must be synchronized with the send sequence function, since it must not close before the ongoing sequence is finished completely