Help with HPWM on 18f6520


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    Join Date
    Apr 2007
    Posts
    53

    Default Help with HPWM on 18f6520

    Hello,

    My first post here so don't be too hard on me!!

    I am currently playing with the HPWM command on the 18F6520. It works ok on CCP1 and CCP2 but I cannot get it to work on CCP 3,4 or 5.

    I have tried a few different setup configurations, however, at present I am stuck!

    Any help or ideas would be greatly apprciated.

    Andy

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Andy Wood View Post
    Hello,

    My first post here so don't be too hard on me!!

    I am currently playing with the HPWM command on the 18F6520. It works ok on CCP1 and CCP2 but I cannot get it to work on CCP 3,4 or 5.

    I have tried a few different setup configurations, however, at present I am stuck!

    Any help or ideas would be greatly apprciated.

    Andy
    Can't see no code, can't give no help.

  3. #3
    Join Date
    Apr 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default

    Thanks for the reply Skimask.

    Here is a copy of the code:

    main:

    HPWM 1,127,245

    HPWM 2,127,245

    HPWM 3,127,245

    HPWM 4,127,245

    HPWM 5,127,245

    GOTO main

    When using a 5v supply, this produces 2.5v on CCP channels 1 and 2, and 0v on CCP channels 3,4 and 5 (which are on port G).

    I also tried adding TRISG = 0 at the start, to force CCP 3,4 & 5 to outputs but nothing changed.

    Andy

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Andy Wood View Post
    Thanks for the reply Skimask.
    Here is a copy of the code:
    main:
    HPWM 1,127,245:HPWM 2,127,245:HPWM 3,127,245:HPWM 4,127,245:HPWM 5,127,245:GOTO main
    When using a 5v supply, this produces 2.5v on CCP channels 1 and 2, and 0v on CCP channels 3,4 and 5 (which are on port G).
    I also tried adding TRISG = 0 at the start, to force CCP 3,4 & 5 to outputs but nothing changed.
    Andy
    That's it? No defines, don't know how fast the oscillator is runng, no registers set up, no nothing?
    Read the manual, try again...

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


    Did you find this post helpful? Yes | No

    Default

    HPWM only works with CCP1 & CCP2. Beyond that, you'll need to manually configure hardware PWM.
    Regards,

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

  6. #6
    Join Date
    Apr 2007
    Posts
    53


    Did you find this post helpful? Yes | No

    Default

    Hello Bruce,

    Thanks for the reply. I have read the manual and cannot find where it says HPWM is only for CCP1 and CCP2. Maybe this is an undocumented "feature"?

    Anyway, I do appreciate your response - I have been pulling my hair out! Thank you for your input.

    Andy

Similar Threads

  1. need help on hpwm
    By helmut in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th August 2007, 15:49
  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 usage with the 18F6520
    By slxrti in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 17th November 2005, 16:57

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