Updating HPWM frequently, safe?


Closed Thread
Results 1 to 40 of 79

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    The frequency must be a variable.
    You can't pass a constant as the parameter.

    And just shift left 2 (<<2) to use 8-bit values.

    hth,
    DT

  2. #2
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Angry Re: Updating HPWM frequently, safe?

    Old thread but very relevant to my issue.

    Can I use HPWM10:

    1. On an 18F87J50?
    2. And have it glitch free?
    3. To make a pulse train that's 140mS long and have varying duty cycles within the pulse train?

    In other words: 300uS on, 200uS off, 300uS on on, 200uS off, 130uS on, 370 uS off, 300uS on, 200uS off, 130uS on, 370uS off, 170uS on, 330uS off, 130uS on, 370uS off, etc.

    Each bit is 500uS and I don't need to modify anything while the packet is being sent; I can modify right before the next one is sent.
    Last edited by Christopher4187; - 16th June 2015 at 14:50.

  3. #3
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Updating HPWM frequently, safe?

    If by “glitch free” you mean free of any resolution error, not every frequency or duty cycle you want to generate will be.
    for any particular frequency, you need the pic’s clock frequency to tell you that.
    This online PWM calculator can tell you:
    http://www.micro-examples.com/public...alculator.html

    whether or not you can change it for arbitrary duration for every pulse like that would be a tough one,
    I don’t think that’s possible, but might be wrong.

    Depending what else the chip has to do, it might be possible to use timer1 overflow that way.
    Last edited by Art; - 18th June 2015 at 19:58.

Similar Threads

  1. need help on hpwm
    By helmut in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th August 2007, 15:49
  2. HPWM of the port of two HPWM
    By ja2rqk in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th April 2007, 15:05
  3. sound command & music
    By trying in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th May 2006, 14:14
  4. HPWM and A to D interaction question 18F252
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 10th May 2006, 03:50
  5. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts