Is this PIC micro-controller powerful enough to drive PWM LEDs

ledmicrocontrollerpwm

Short Question

Is a PIC24F16KM202 (Datasheet) powerful enough to vary the brightness of 12 LEDs from 12 PWM outputs without any visible stepping of brightness levels?

——————————————-

Full Question

After using Microchip's PIC search tool to narrow down an MCU based on my project's requirements, it only really leaves me with PIC24F16KM202.

My concern is that some of the specs it has are at the very low end of the scale compared to other PICs, and having no real experience before with micro-controllers (this is my first MCU / electronics project), I'm not sure exactly if / how it will affect the performance of my project.

The project is really based on driving RGB LEDs via PWM, and I want to make sure that the PIC is capable of fading the LEDs smoothly with no visible jumping between brightness levels, and also if the MCU will be powerful enough to store and run the program.

I'd like to get some advice before buying some and finding out they're not going to be good enough and starting over.

Brief Project Outline:

  • 12*PWM to drive 4 sets of RGB LEDs independently (through transistors).

  • UART to connect to a bluetooth module (RN4020?) to control the colour of the RGB LEDs.

  • 6 input pins to change the state of the RGB LEDs.

  • EEPROM to store last state between on/off.

RGB LED colour will be changed infrequently by UART / bluetooth. Brightness / on / off will be driven frequently by 6 inputs.

PIC24F16KM202 specs:

  • Max. PWM Outputs: 16

  • PWM Time Bases: 5

  • PWM Resolution (bits): 16

  • PWM Resolution (ns): 62

  • CPU Speed (MIPS): 16

  • Program Memory (KB): 12

I've been reading the PIC24F Datasheet and Googling for ages to try and figure it out, but honestly I'm overwhelmed by the amount of information that I don't yet understand. I'd very much appreciate if someone could help me out by answering my question, and/or point me to some concise and relevant material that will allow me to learn how to answer the question myself.

Thanks for your time 🙂

Best Answer

Looking at the datasheet for that device, you would need to use the output compare function to control the PWM. However it looks like you wont be able to set 16 individual PWM periods, therefor this may not do what you are hoping. You would probably be better off using the outputs pins as general I/O and using interrupts to create your own PWM periods. If you do it yourself using interrupts, your choice of micros may open up.