Setting up 5 HPWM pins on 18F4680


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Location
    San Diego
    Posts
    35

    Question Setting up 5 HPWM pins on 18F4680

    I need to setup 5 hardware PWM outputs on the PIC18F4680.
    Has anyone set these up as dedicated outputs that run in the background?
    I see the PB setup for HPWM 1, and 2 but not anything more that 2.
    Do I have to drop into assembly code to do this or are there defines that I can do that will allow me to just select HPWM 1, 2, 3, 4, and 5.
    The frequency of each output can be the same... only the duty cycle needs to vary from 0 to 100% on each pin.

    Thanks,
    Tcbcats

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    As far as i remind, this one have only 1 CCP module and hence, one PWM output but up to 4 if using the ECCP feature... wich will never solve your problem, all output are complementary (or something like that ). So you'll have to build a homebrew routine. A TIMER interrupt for the base frequency and play with the various duty cycles in the ISR.

    Kind of background. Look at the Darrel Taylor instant interrupt. Should be handy and work really great.
    Last edited by mister_e; - 2nd August 2006 at 05:59.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. PICs can do more if use others than delays instructions
    By hardcore in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 24th February 2010, 19:52
  2. PICKit2 - warning about configuration words
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 4th August 2009, 14:01
  3. Problem setting pins on 12f675
    By srnet01 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th February 2009, 15:58
  4. sound command & music
    By trying in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th May 2006, 14:14
  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 : 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