HPWM confusion


Closed Thread
Results 1 to 13 of 13

Thread: HPWM confusion

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    747

    Default HPWM confusion

    Hi,

    I am learning the HPWM command.. mainly because I need a PWM for my motors. But I was wandering what the command ccp1 does in the Pic16f876a chip does. At first I thought I needed it, but then i saw that the Pic16F84 dont have one and it is possible to have PWM, Actually I guess its a question of, what pin is turning on and off at a specific duty cycle. So what is the PWM mode in the pic16F876a with the CCP0, CCP1, What does it give more then the 16F84 chip.

    thanks

    ken

  2. #2
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    The PWM command in PBP is a software pwm generator. When this command is running nothing else is workin until the pwm genarator is ready, because you give the dutycycle and the number of cycles of this pwm to the genarator.
    When the cycles are done then the next command is working.
    The HPWM command is a command what goes directly to the hardware buils in pwm generator. When it is started is will work until you give a command to stop or to give it another dutycycle. Meanwhile your programm is doing then next instructions without concirning about the pwmgenerator.

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


    Did you find this post helpful? Yes | No

    Default

    For CCP1, I also would like to ask a question in addition to lerameur's, as I am also having new experiences with PWM.

    1. When setting PR2 and CCP1, say we set CCP1 for a fixed number. Then we play with PR2 to get the correct freq (in brief I say it this way).

    2. But, when I set PR2=255 fixed, and then play with CCP1, I also get the same freqs as in number 1 above.


    So what should be my question here, I am not sure.


    -----------------------
    Last edited by sayzer; - 3rd November 2006 at 08:58.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    >> But I was wandering what the command ccp1 does in the Pic16f876a chip does.

    CCP1 is NOT a command, but a REGISTER within your PIC.

    To discover what it does, download and read the Datasheet for your PIC16F876A. A really good place to start is section 8 - Capture/Compare/PWM Modules.

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


    Did you find this post helpful? Yes | No

    Default

    Welcome back Melanie!



    ----------------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  6. #6
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    So grossely, I am doing a line following robot, if I use PWM, then the sensors are not working. Also, I only have two channel to use PWM, so only two motors can use HPWM on one chip. right?

    k

Similar Threads

  1. HPWM Confusion in spec sheet
    By lerameur in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th September 2008, 00:48
  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. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43
  5. HPWM confusion
    By rossfree in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd November 2005, 16:50

Members who have read this thread : 1

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