PWM frequency cakculation

Discussion in 'Embedded Systems and Microcontrollers' started by Irmutis, Jan 30, 2012.

  1. Irmutis

    Thread Starter Member

    May 24, 2009
    17
    0
    Hi,


    I want to ask how I can calculate PWM frequency if I have 32bit timer and Fosc=70MHz? How to calculate maximum and minimum PWM signal frequency?
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    What device?
     
    Irmutis likes this.
  3. Irmutis

    Thread Starter Member

    May 24, 2009
    17
    0
    I am going to use LPC1768 processor.
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Sorry, that is not a device I am familiar with.
     
    Irmutis likes this.
  5. Irmutis

    Thread Starter Member

    May 24, 2009
    17
    0
    ErnieM maybe you can tell how to calculate PWM frequency for your device?
     
  6. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    I believe he was asking "What will the PWM be driving", such as a motor, LED, piezo, etc.

    The frequency for those is pretty much platform independent. Most here use PIC microcontrollers, but there are some familiar with ARM Cortex. I don't recall everything, and they've added a lot.
     
    Irmutis likes this.
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    My device here is a PIC12HV615, and the PWM frequency is set by the Timer2 compare feature: when timer 2 meets a value set in the PR2 register the period is complete, and the timer is reset.

    My instruction clock is 1MHz, I use a 16:1 prescaler on the timer, and the max in PR2 (0xFF). This yields the lowest PWM frequency one can obtain this way of:

    1MHz / 16 / 256 = 244.140625

    And I am sure that is of no help to your needs. :D
     
    Irmutis likes this.
  8. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    try Google and LPC1768 pwm
     
    Irmutis likes this.
Loading...