PWM generation with PIC16F628


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by HankMcSpank View Post
    now I'm no programmer and I might be laying myself bare for everyone to laugh at, but this is how I'd likely approach it...
    That is my story too... And it does not stop me.

    127 exactly might be hard to get with a POT so maybe change the range some.

    Code:
    if (pot_sample >= 122) AND (pot_sample <= 132) then
    
    if pot_sample > 132 then
    
    if pot_sample < 122 then
    Last edited by mackrackit; - 15th July 2010 at 22:31. Reason: TYPO
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Aug 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Thanks for help guys!

    This laste if and is important, because of tolerance on POT and so, is better to ahve some more dead time between forward and reverse! Will try this and let you know how it works.

  3. #3
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Marin View Post
    Thanks for help guys!

    This laste if and is important, because of tolerance on POT and so, is better to ahve some more dead time between forward and reverse! Will try this and let you know how it works.
    I'd considered a 'dead window' in the middle, but didn't go there as you'd not asked & thought it better to keep it 'pure' so to speak - not sure how/the tolerance of the pot comes into play with respect to you last post - the tolerance refers to how far out the actual resistance is from the specified resistance - you don't really care whether say a 10k pot is 9.8k or 10.2k ...the middle point of your pot will be 127 (unless they've some whacky non linear way of making the pot's carbon track!)...you need the 'dead window' not for tolerance purposes, but to have a better chance of finding/hitting the point on the pot where both sides are at rest.

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