Problem with intensity.. plz help


Results 1 to 8 of 8

Threaded View

  1. #4
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Srig,

    Srig>>I am performing software pwm . the following works on multiple pins at
    the same time doing software pwm.

    For Duty = 0 to 999

    For cycles = 0 to Cycle1
    Portb = %00000000
    Pauseus 999 - Duty
    Portb = %00100000
    Pauseus Duty
    Next cycles

    but what I was trying to do is make three separate pins turn on at the
    same time but all three of them need to be on a different intensities.
    for instance one has to be on at LED1 = (20%)
    LED2 = (30%)
    LED3 = (80%)

    here is what I have so far.. not sure if it is working but just need
    someone to verify that this will work. I was hoping that you would do
    this for me.

    <<

    To make 3 separate pins to turn on at the same time with different intensities, you must use a PIC chip that has three PWM's built into the chip. That I know of, there is only one PIC chip out there that has 3 PWM's. (But could be more)

    The software PWM will not work. It is only good for one pin at a time. You will need the chip that has 3 hardware PWM's.

    Then your code will be something like the following:

    x=256*.2
    y=256*.3
    z=256*.8


    HPWM 1,x,2000
    HPWM 2,y,2000
    HPWM 3,z,2000


    Dwayne
    Last edited by Dwayne; - 6th October 2004 at 19:21.
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. sleep problem help plz >>>.
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 16th November 2009, 09:21
  2. Problem with ports help plz
    By Mus.me in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 2nd August 2009, 22:51
  3. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 09:12
  4. ESC problem plz help
    By al000y in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 21st January 2007, 11:21
  5. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 23:59

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