Multiple HPWM question


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Posts
    56

    Default Multiple HPWM question

    Hello,

    I just made an experiment with 18F4431 again.
    The blinky program works, and now I want to have multiple / simultanous HPWM
    My code did not work, How to setup so the RB0,1,2,3 become PWM PORT ? Is there any other register to modify ? Thanks

    Code:
    DEFINE OSC 8            ' Oscilator HS
    
    TRISA = %00000000               ' Set PORTA to all output
    TRISB = %00000000               ' Set PORTB to all output
    TRISC = %00000000               ' Set PORTC to all input
    TRISD = %00000000               ' Set PORTD to all output
    TRISE = %00000000               ' Set PORTE to all output
    ANSEL0= %00000000               ' Analog channel AN0-AN7 off
    ANSEL1= %00000000               ' Analog channel AN8 off
    
    main:
    hpwm 0, 100, 7000    'RB0 as hpwm output
    hpwm 1, 180, 7000    'RB1  as hpwm output
    hpwm 2, 250, 7000    'RB2  as hpwm output
    goto main

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    See the example in this thread http://www.picbasic.co.uk/forum/showthread.php?t=7095

    Between that & the data sheet you should be able to get it going.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Jun 2007
    Posts
    56


    Did you find this post helpful? Yes | No

    Thumbs up

    Thank you Bruce,

    It works

Similar Threads

  1. General Question About Multiple Interrupts
    By grzeh666 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 31st August 2008, 17:09
  2. Newbie HPWM / ADC question
    By Johan in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 25th June 2007, 12:52
  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 : 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