[vz-dev] whm - the software side

Justin Otherguy justin at justinotherguy.org
Sat Feb 12 21:31:11 CET 2011


Hi there,

we still have a few steps to go to get hour whm (working hour meter) to work properly.
I've tested Udo's board [1] - works like a charm (thanks again!).

The thing is: we get a pulse every second the device is switched on. This is good in terms of resolution (intrinsic error is +-0.5 secs) but bad in terms of effecient network resource usage...
So I wondered: 
why don't we introduce something like a prescaler for pulse inputs?
Could work like this:
- ISR remains unchanged
- code outside ISR at present looks like this:
  - did we receive an interrupt since we've checked the last time?
  -> yes -> fire a http request
  -> no -> do nothing
- we could extend it something like this:
  - did we receive an interrupt since we've checked the last time?
  -> yes -> is the prescaler enabled for this pin?
    -> yes -> is the prescaler_counter less then the prescaler value?
      -> yes -> increment the prescaler value
      -> no -> fire a http request
    -> no: fire a http request
  -> no: do nothing

We would need:
- conf parms:
  - CONF_WATCHASYNC_PA0_PRESCALER [BOOL] for every pin (optional)
  - CONF_WATCHASYNC_PA0_PRESCALER_VALUE [INT] for every pin (optional)
- consts:
  - WATCHASYNC_PA0_PRESCALER_VALUE [INT] for every pin (optional)
- variables:
  - WATCHASYNC_PA0_PRESCALER_COUNTER [INT] for every pin (optional)

I would think that the complexity introduced with this step is acceptable.

Any comments?


Regards, J.

[1] http://wiki.volkszaehler.org/hardware/channels/meters/working_hours



More information about the volkszaehler-dev mailing list