18 PWM Microcontroller

Discussion in 'Embedded Systems and Microcontrollers' started by Pawel19, Sep 1, 2012.

  1. Pawel19

    Thread Starter New Member

    Sep 1, 2012
    I am trying to find a microcontroller which would give me individual control over 6 RGB LED's. I'm pretty new to all of this, but I heard the simplest way to do this would be to use PWM for each diode. I believe this would necessitate 6*3 PWM slots. Are there any microcontrollers that offer this capability? Most importantly, my budget is ~$20.

    Assuming there is no product which fits my needs in my price range, what are other options open to me?

    BTW I have another thread open here, but I thought this question might be more appropriate in this forum. If this is considered spamming, please let me know and I will remove this thread.
  2. Pawel19

    Thread Starter New Member

    Sep 1, 2012
    The project I am trying to to can be accomplished with this sort of setup apparently, but I can't find much information on it. It consists of a on/off switch, wiring for the LED's, a microUSB slot, and a Li Ion battery. If anyone could help that would be great!

  3. MMcLaren

    Distinguished Member

    Feb 14, 2010
    There are probably several different microcontrollers out there with eighteen hardware PWM outputs but many designers, I suspect, would use software PWM instead of hardware PWM, or they might use LED driver ICs with built-in PWM capability.

    A relatively simple solution might use soft PWM and directly drive the eighteen LEDs from the microcontroller or multiplex the displays to use fewer pins (but use slightly more 'peak' current per LED for the same 'average' current and brightness level).

    Software PWM methods vary. What I would aim for is, (1) the smallest possible PWM "step" size (anything under 1-usec is great), and, (2) the fastest possible refresh rate. I often use a custom (proprietary) high performance BAM (bit angle modulation) driver with gamma corrected linear brightness/color level capability.

    As for a USB connection, you might consider using an inexpensive Chinese Nokia CA-42 clone USB-to-serial cable which costs less than $3(USD). Simply cut off the cell phone connector and replace it with a 3.5mm stereo plug which connects to a 3.5mm stereo jack on your project board.

    Good luck with your project.

    Regards, Mike
  4. Pawel19

    Thread Starter New Member

    Sep 1, 2012
    Thank you! That was very helpful. I just found some stuff about soft PWM and it seems that would be the way to go. Unfortunately, I still didn't understand some of what you described.

    If you follow my link to my larger project description, you'll see that I require a small PWM "step" size as you described because my LED's will undergo a decent velocity and I want there to be no noticeable strobing effects unless I say so! BAM is also something I've seen a tiny bit of and that seems to be the best solution. I don't know anything about gamma corrected linear brightness/color level capability though. Could you expand on this please?

    Also, thank you for your idea on the USB-to-serial cable mod, but I'd like to keep things as simple as possible and can probably splurge the extra money for a cable.

    Would you possibly care to explain more about BAM as you explained it or lead me towards some helpful resources? As far as hardware, what do you think would be the best for my stated project goals? I really am very uninformed on this whole topic but very eager to learn. I don't really know anything about drivers, transistors, etc., but I'm trying to learn as quickly as possible. Not sure if it's asking too much, but could you lead me towards some parts I could use to complete my goals?

    Thanks again!

    Edit: I was looking at Arduino and Teeny because of the simplicity and documentation, but I'm open to any suggestion. I'd like to keep the cost of the driver (including the battery, minus the wires) to around $30-$40 or less.
    Last edited: Sep 1, 2012