I need to Develop PWM with frequency from 1 HZ to 100 KHZ with 10 bit resolution. I am using Clock reference at 1 MHz to drive an NCO. The problem is - how to produce 10bit resolution PWM for those frequncies. I tried CLC. Rising edge of NCO pulse turning on D flipflop and starting Timer 1 counting 1 MHz pulces up to preset value. Timer 1 overflow should reset D flipflop. This defines the logic, but I cannot write code, which will imlement this logic. Please help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PWM with frequency from 1 HZ to 100 KHZ with 10 bit resolution..
see help..
frequency sets the frequency of the PWM output. It is measured in KHz. The maximum value allowed is 255 KHz. The minimum value varies depending on the clock speed. 1 KHz is the minimum on chips 16 MHz or under and 2 Khz is the lowest possible on 20 MHz chips. In situations that do not require a specific PWM frequency, the PWM frequency should equal approximately 1 five-hundredth the clock speed of the microcontroller (ie 40 Khz on a 20 MHz chip, 16 KHz on an 8 MHz chip). This gives the best duty cycle resolution possible.
A 64MHz pic could give 125KHz. pwm out.
Connect to an input and count?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need to Develop PWM with frequency from 1 HZ to 100 KHZ with 10 bit resolution. I am using Clock reference at 1 MHz to drive an NCO. The problem is - how to produce 10bit resolution PWM for those frequncies. I tried CLC. Rising edge of NCO pulse turning on D flipflop and starting Timer 1 counting 1 MHz pulces up to preset value. Timer 1 overflow should reset D flipflop. This defines the logic, but I cannot write code, which will imlement this logic. Please help!
Did anybody tried to implement AN3380 in GCBasic?
or AN1476?
PWM with frequency from 1 HZ to 100 KHZ with 10 bit resolution..
see help..
frequency sets the frequency of the PWM output. It is measured in KHz. The maximum value allowed is 255 KHz. The minimum value varies depending on the clock speed. 1 KHz is the minimum on chips 16 MHz or under and 2 Khz is the lowest possible on 20 MHz chips. In situations that do not require a specific PWM frequency, the PWM frequency should equal approximately 1 five-hundredth the clock speed of the microcontroller (ie 40 Khz on a 20 MHz chip, 16 KHz on an 8 MHz chip). This gives the best duty cycle resolution possible.
A 64MHz pic could give 125KHz. pwm out.
Connect to an input and count?