Shop OBEX P1 Docs P2 Docs Learn Events
Sx48 - pwm — Parallax Forums

Sx48 - pwm

SailerManSailerMan Posts: 337
edited 2007-01-23 18:05 in General Discussion
I just purchased an SX48 specifically to use the PWM feature of the timers.

Can someone help explain how the·Clock speed say 50 mhz and Timer R1 and Timer R2 effect the PWM output. What is optimal for a PWM Frequency. What are some good settings.

Any help or insight would be greatly appreciated,

Thanks
Eric
·

Comments

  • BeanBean Posts: 8,129
    edited 2007-01-23 17:26
    Eric,
    It depends on what resolution you need.

    8 Bits = 256 clocks = 50MHz / 256 = 195.3125KHz PWM Frequency
    10 Bits = 1024 clocks = 50MHz / 1024 = 48.828125KHz PWM Frequency

    In SX/B you can simply use "TIMER1 PWM, value, 256" for 8 bit or "TIMER1 PWM, value, 1024" for 10 bit.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1

    "USA Today has come out with a new survey - apparently, three out of every four people make up 75% of the population." - David Letterman
  • SailerManSailerMan Posts: 337
    edited 2007-01-23 18:05
    Thanks for that... It ties it together for me. I totally understand. [noparse]:)[/noparse]
Sign In or Register to comment.