Pwm 16f876a


Results 1 to 9 of 9

Thread: Pwm 16f876a

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    what happen if you remove
    Code:
    DEFINE CCP1_REG PORTC ; HPWM 1 pin port
    DEFINE CCP1_BIT 2 ; HPWM 1 pin bit
    DEFINE CCP2_REG PORTC ; HPWM 2 pin port
    DEFINE CCP2_BIT 1 ; HPWM 2 pin bit
    Since this PIC don't have alternate pin for any CCPx, i don't know how it's handled.

    And the obvious, if i can... did you really selected the right PIC in the editor?

    Also, you should have a space between @ and __Config. But it could be a forum copy/paste problem so..

    Also, even if not PWM related
    Code:
    DEFINE HSER_BAUD 9600 ; 9600 Baud USART
    DEFINE HSER_RCSTA 90h ; Enable USART RX
    DEFINE HSER_TXSTA 24h ; Enable USART TX
    DEFINE HSER_SPBRG 51 ; 9600 Bauds
    DEFINE HSER_CLROERR 1 ; Clear all USART errors as they happen
    You have two definition of the Baudrate... one is false. Or you keep HSER_BAUD 9600 or you correct the HSER_SPBRG 51 to HSER_SPBRG 129. 51 is the right value for 8MHZ.
    Last edited by mister_e; - 19th September 2006 at 05:58.
    Steve

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

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 setting PIC16F887
    By Gevo in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th June 2008, 07:24
  4. 16f876a Pwm
    By Hainkm in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th December 2007, 17:33
  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