pot controlled pwm -- help


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Thumbs down ON/OFF vs PWM

    Hi, Sayzer

    PWM is intended to know what you apply to your load, your design is very very very very far from giving a known output ... it's more an ON/OFF output than anything else.

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2
    Join Date
    Sep 2005
    Location
    Dayton, Ohio
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    I don't really care for the HPWM command. I think it's easier to manually set the registers. This is a conversion from part of my code that may work for you to at least get the PWM working.

    This is for an 8MHz oscillator (on a 18F2525, so double check register names):

    T2CON = 4 'Timer2 = ON; Prescale = 1:1
    PR2 = 200 '(period) this should give you should give you about 10KHz
    CCPR1L = 100 '(duty cycle) 100 should be close to 50%, 20 is about 10%, etc

    To turn PWM ON:
    CCP1CON = 12

    To turn PWM OFF:
    CCP1CON = 0
    Jim Robertson
    "MilesTag" DIY Lasertag
    www.lasertagparts.com/mtdesign.htm
    Dayton, Ohio

  3. #3
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Cool

    Hi Acetronics,

    PWM filter is not something I created through my output port; it is what picbasic pro recommends.
    If you check the manual or help files, you will find this filter as a solution to scarry pwm out. Still, it is optional.

    If you know something else, pls share it with us so that we can learn. Also, PWM is already an on/off state with different intervals on ON mode, on OFF mode etc. and this is called "modulation".

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Talking The Missing resistor ...

    Hi, sayzer

    As you're asking, it's a pleasure ...

    Just insert a resistor between your Emitter and ground, and the transistor collector current will simply follow linearly ( w. a little offset due to Vbe ...) the PWM value ...
    An U/I converter w/ OpAmp could wipe off this offset, if needed ...

    No, no, don't send flowers ....

    Alain
    Last edited by Acetronics2; - 29th January 2006 at 12:33.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Half-bridge PWM with a 16F684 ?
    By Byte_Butcher in forum General
    Replies: 7
    Last Post: - 17th January 2010, 22:18
  2. Variable PWM PIC18F2431
    By trr1985 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th June 2009, 06:03
  3. Serial controlled PWM
    By The Master in forum Off Topic
    Replies: 1
    Last Post: - 26th November 2007, 06:47
  4. Replies: 4
    Last Post: - 24th January 2007, 22:20
  5. Tidying Up PWM Routine
    By Tissy in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st February 2005, 00:26

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