Hi Mike and Mike,
The input pulses are always 1 ms long and both repeat at 80 Hz. They are relative to each other, with the data being the time between leading edges or the phase difference. One pulse stream could be considered a reference and the position of the other data. If they were going into a flip flop, one would be set and the other reset. At 50% one pulse lags the other by ~6.25 ms. At 0 and 100 %, the pulses would line up with each other. In effect the input pulses do not quite reach 1 and 100%.
The 25 Hz output should reach 100% on (continuously on) and 0% as off.
K8LH,
"very fast" = minimum delay. It would be nice if the output could be updated with every input period.
I'm not much of a programmer (elementary Basic), and have considered polling the inputs. Not sure how to handle the 1 ms. pulse. There would be several highs for the pulse then a string of lows between the pulses. The transition between high an low would have to be detected with counts accumulated from there.
If polling is used, wouldn’t it be possible to bit bang the output for every input poling cycle?? Any resultant jitter and variable granularity in the output would be ok, if it doesn't exceed ~1% of the output period.
Regards, Bob