×

Methods and apparatus pulse-width modulation that use a counter and a modulus device

  • US 5,471,635 A
  • Filed: 05/31/1994
  • Issued: 11/28/1995
  • Est. Priority Date: 06/06/1990
  • Status: Expired due to Term
First Claim
Patent Images

1. A method of generating a 2-level square wave signal of a predetermined period and a predetermined non-50% duty cycle on an output lead of a circuit which includes a processor including a timer, the method comprising the computer-implemented steps of:

  • determining from said predetermined period and said duty cycle a duration of a first-level portion of said square wave signal and a duration of a second-level portion of said square wave signal, the duration of the first-level portion being different from the duration of the second-level portion;

    determining from the duration of the first-level portion a first number which is a number of cycles of a clock signal in the first-level portion of said square wave signal, and determining from the duration of the second-level portion a second number which is a number of cycles of the clock signal in the second-level portion of said square wave signal, wherein said second number of cycles is different from said first number of cycles;

    before loading any one of the first and second numbers into a counter that counts on every cycle of the clock signal, decrementing each of the first and second numbers by a number of cycles required to load a value from a modulus device into the counter;

    generating an interrupt signal to the processor when the counter reaches a selected final value;

    in response to said interrupt signal, performing the steps of;

    if a signal on said output lead is of a first level, then changing the signal on said output lead to a second level different from said first level; and

    if the signal on said output lead is of said second level, then changing the signal on said output lead to said first level; and

    loading the value from the modulus device into said counter;

    following the above steps, counting by said counter towards said final value;

    in response to said interrupt signal, after said level changing step but before said counter reaches said final value, and while said counter counts towards said final value, leading by said processor said modulus device with;

    said first number of clock cycles if said signal is of said second level; and

    said second number of clock cycles if said signal is not of said second level; and

    repeating the step of generating the interrupt signal and the step of changing the signal on said output lead thereby generating on the output lead the signal having the non-50% duty cycle.

View all claims
  • 0 Assignments
Timeline View
Assignment View
    ×
    ×