30 PWM outputs on one chip?


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429

    Default 30 PWM outputs on one chip?

    I've got a 40-pin PIC that I would like to use 30 of the i/o pins as pwm outputs in order to drive 10 RGB LEDs. I would be using a frequency 60Hz for all and an 8-bit resolution on the duty cycle.

    My thought is to use a timer interrupt of 60*256=15360Hz and have the interrupt for it set each output according to its individual duty cycle value.

    I realise that this will be processor intensive, but I am planning on having 6 of these for a total of 180 PWM outputs all controlled by a main master PIC which will do most of the processing and simply send the duty cycle values to the other PICs.

    Can anyone see any problems with this?

    One thing I have thought of is the current - unless i have a transistor on each output i will only be able to draw about 6.7mA per output due to the PIC's max current sink/source of 200mA.

    Alternately, does anyone have any better ideas on how to drive 60 RGB LEDs?
    Last edited by Kamikaze47; - 24th September 2009 at 07:28.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  2. #2
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Alternately, does anyone have any better ideas on how to drive 60 RGB LEDs?
    Read the following thread:

    http://www.picbasic.co.uk/forum/show...ghlight=bambam

    Al.
    All progress began with an idea

  3. #3
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Very interesting, thanks aratti.

    It looks like MIBAM will be the way to go.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

  4. #4
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Default

    I would say that 60Hz would be too low when using this type of PWM, i don't know about MIBAM since i've never used it. Using old(normal) style PWM you will see flickering when using low dutycycles, the problem is that the pauses between the pulses of light is long enough for the eye to see(atleast for my eyes, this varies for different people). I've done a pwm controller once and found that i still had visible flicker at 100Hz when using dutycycles below 2-3%. At 200Hz the problem went away. Thinking about it, i would suspect that MIBAM would have the same problem, atleast at 1 LSB dutycycle.

  5. #5
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Thanks Ingvar - You are right, I found that 60Hz was too low.

    I tried DT's MIBAM but for some reason it kept crashing the compiler. So I ended up implementing MIBAM myself at 90Hz (including the mirror image, so equivalent to 180Hz standard BAM) and am quite happy with the result. 30 outputs, 8-bit resolution running on an 18F4550 @ 48MHz.
    "I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams

Similar Threads

  1. 12F683 2 x PWM Outputs
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 23rd July 2021, 20:20
  2. DMX512 Reception + 3 * 8-Bit PWM Outputs
    By JEC in forum Code Examples
    Replies: 5
    Last Post: - 16th February 2015, 15:21
  3. Half-bridge PWM with a 16F684 ?
    By Byte_Butcher in forum General
    Replies: 7
    Last Post: - 17th January 2010, 22:18
  4. Variable PWM PIC18F2431
    By trr1985 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th June 2009, 06:03
  5. Multiplexing PWM pin with other outputs
    By bcd in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 19th September 2006, 11:24

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