Help with 16F684 PWM


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2006
    Location
    Indiana, USA
    Posts
    72

    Unhappy Help with 16F684 PWM

    I need some help getting PWM to work on a 16F684 to drive 2 motors.
    I got DT's HPWM10.pbp to work on PORTC.5 fine, but I've had no luck in getting channel 2 to run.

    Works:

    for i = 1 to 10
    dutycycle1 = dutycycle1 + 101
    @ HPWM10 1,_DutyCycle1, _Frequency
    pause 80
    next i
    dutycycle1 = 0

    Doesn't work:

    dutycycle1 = 0
    dutycycle2 = 1023
    for i = 1 to 10
    dutycycle1 = dutycycle1 + 101
    dutycycle2 = dutycycle2 - 101
    @ HPWM10 1,_DutyCycle1, _Frequency
    @ HPWM10 2,_DutyCycle2, _Frequency
    pause 100
    next i
    for i = 1 to 10

    I'm guessing it wont work on the 2nd channel because its not a regular hardware PWM port?
    any help would be just dandy!

  2. #2
    Join Date
    Sep 2006
    Location
    Indiana, USA
    Posts
    72


    Did you find this post helpful? Yes | No

    Default nevermind

    I should have searched before I asked, sorry!
    but does anyone have a routine or thought of writing one that will allow enhanced PWM to work like CCPPWM? I'm not all that great at coding assembly myself...

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. PWM 'channels ...what's that all about then!
    By HankMcSpank in forum General
    Replies: 5
    Last Post: - 23rd April 2009, 16:49
  4. PWM setting PIC16F887
    By Gevo in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th June 2008, 07:24
  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