Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For MSX the duty-cycle was calculated instantaneously, this was improved in MSXI by using a time-averaged duty-cycle to reduce noise and improve accuracy. The duty-cycle was detected using rising and falling edge detection, essentially this means that the I/O pin we are monitoring the signal on alerts the software through an interrupt vector whenever the signal switches from low to high (rising) or high to low (falling). These vectors trigger code to read the internal clock time of the signal change to a pair of ring buffers one for rising and one falling. By computing the duration between two rising events we can determine the period of a cycle. By computing the duration between the first rising and next falling event the active time can be determined. Dividing the active time by the period we can determine the duty cycle. By averaging these results we can get a good idea of the average duty cycle for a short period, this is the mapped to the current value using the manufacturer's function. In MSX these values were not averaged and as a result, the accuracy was lower.

...