Strangw results when using PWM command


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Steve, went the hole hog and dropped in a 68R and it works a treat !!

    Thanks for your help

    Cheers

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


    Did you find this post helpful? Yes | No

    Default

    You're welcome... just make sure that your Zener and resistor are rated to handle it ...
    Resistor 68ohm... (12-5)/68=103mA, 103mA*103mA * 68 = 0.72W => 1 watt
    Zener 5 Volt : 5*103mA = .515 Watt => could be 1/2 watt... i calculate the worst case, VMax,No Load
    Last edited by mister_e; - 9th July 2006 at 20:48.
    Steve

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

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink Good old bulbs ...

    Hi, Malc

    I just tried this ... good for bulb lamp- like ... an rather simple.

    DEFINE OSCCAL_1K 1

    ADCON0 = 0
    ANSEL = 0
    CMCON = 7

    TRISIO = %00001000

    led var GPIO.0

    i var byte
    y var byte
    Speed var word ' just if speed > 255 ...

    Speed = 100

    up:

    Pause (Speed*2)

    For i = 0 to 127

    y = SIN i

    Led = 1
    Pauseus (Speed*y)
    Led = 0
    Pauseus (Speed*( 127-y ))

    next i

    GOTO up
    END

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default better visual results ...

    DEFINE OSCCAL_1K 1

    ADCON0 = 0
    ANSEL = 0
    CMCON = 7
    VRCON = 0


    TRISIO = %00001000

    led var GPIO.0

    i var byte
    y var word

    up:

    Pause 200

    For i = 0 to 127

    y = SIN i

    Led = 1
    Pauseus (y*y)
    Led = 0
    Pauseus ( 16129 -(y*y) )

    next i

    GOTO up
    END
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 21:31
  2. Variable PWM PIC18F2431
    By trr1985 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th June 2009, 07:03
  3. turning gpio.0 high after pwm command
    By sirvo in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 21st February 2007, 19:22
  4. Can I do this???
    By noobie in forum mel PIC BASIC
    Replies: 2
    Last Post: - 10th June 2006, 19:57
  5. Searches
    By bearpawz in forum Forum Requests
    Replies: 11
    Last Post: - 7th November 2005, 19:47

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