16f876a Pwm


Closed Thread
Results 1 to 6 of 6

Thread: 16f876a Pwm

Hybrid View

  1. #1
    Join Date
    Dec 2006
    Posts
    6


    Did you find this post helpful? Yes | No

    Thumbs up The Code...

    Here's some code. Thanks for the help!!

    @ device PIC16F876A, hs_osc, wdt_off, pwrt_off, bod_off, lvp_on, cpd_off

    TRISA=%00000000
    TRISB=%00000000
    ADCON0=7
    ADCON1=7

    W VAR BYTE

    TheLoop:

    FOR W=1 TO 255
    PWM PORTB.0,W,1
    NEXT W

    HIGH PORTB.0

    PAUSE 1000

    ' As soon as I start this PWM on PORTB.1, PORTB.0 goes LOW...this is what I need to fix.

    FOR W=1 TO 255
    PWM PORTB.1,W,1
    NEXT W

    HIGH PORTB.1

    PAUSE 1000

    GOTO TheLoop

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    968


    Did you find this post helpful? Yes | No

    Default

    You don't seem to have the RBPU enabled in your code (OPTION_REG) and also you may not be having external pull ups on the PWM output pins. So, when the PWM code executes, it does the RMW routine and PortB.0 goes low. You could check on this.

    JF

  3. #3
    Join Date
    Dec 2006
    Posts
    6


    Did you find this post helpful? Yes | No

    Smile Fixed!

    That did the trick! Thank you so much!

    Hainkm

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. Pwm 16f876a
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th September 2006, 06:35
  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