Menu

PWM using NCO and CLC

2020-06-28
2020-06-30
  • Isay Goltman

    Isay Goltman - 2020-06-28

    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!

     
  • Isay Goltman

    Isay Goltman - 2020-06-30

    Did anybody tried to implement AN3380 in GCBasic?

     
  • Isay Goltman

    Isay Goltman - 2020-06-30

    or AN1476?

     
  • stan cartwright

    stan cartwright - 2020-06-30

    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?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.