
Loop:
indicate not idle on output
load counter with the timing value
repeat
  if counter=0
     indicate idle on output
  else
     decrement counter
until input=<u>high</u>

indicate not idle on output
load counter with the timing value
repeat
  if counter=0
     indicate idle on output
  else
     decrement counter
until input=<u>low</u>
goto Loop
