a method and system produce a pwm signal using a comparator having first and second input terminals and an output terminal at which the pwm signal is produced . the method includes powering the comparator with a supply voltage and receiving a modulating signal at the first input terminal . the method creates a carrier signal with a constant frequency and a maximum amplitude equal to the supply voltage . the comparator receives the carrier signal at the second input terminal and compares the carrier signal to the modulating signal , thereby producing the pwm signal at the output terminal . by creating and using a carrier signal with a maximum amplitude equal to the supply voltage , the pwm signal produced by the method is immune from changes in the supply voltage .