HPWM and timer 1 on pic16f77


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2007
    Posts
    15

    Default HPWM and timer 1 on pic16f77

    im using a pic16f77 and am using the ccp in pwm to generate a 1khz square wave by the following

    DEFINE CCP1_REG PORTC
    DEFINE CCP1_BIT 2

    HPWM 1,127,1000

    this works fine until the main program starts (which uses the timer1 module for a counter) when the frequency changes to around 8Khz and i have no idea. Is there some port i need to set to keep it in hpwm mode or am is there something else going on

    thanks

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


    Did you find this post helpful? Yes | No

    Default

    Probably you did something bad somewhere, this PIC use TIMER 2 for HPWM.

    Post your whole code here.. unless we can't help.
    Steve

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

  3. #3
    Join Date
    Aug 2007
    Posts
    15


    Did you find this post helpful? Yes | No

    Smile

    seem to have sorted it. appears something to do with PIR and PIE registers. commented it out and works as before but without the frequency changing

Similar Threads

  1. PWM Problem
    By cihhan in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th June 2008, 18:43
  2. Totally Baffled with Elapsed Timer
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th June 2008, 21:01
  3. Dead PICs
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 15th August 2007, 13:12
  4. using darrel taylor's instant interrupts
    By Michael Wakileh in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 31st July 2007, 04:07
  5. HPWM the old fashioned way
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 19th November 2004, 19:09

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