It seems like a simple task, but it actually is not. To do RGB control you need three PWM signals from a MSP430. This equates to needing at least one timer that has three capture control registers. The value line parts included with the launchpad have a timer A0 with 3 CCRs. For whatever reason CCR0 is not available as a configurable hardware output; or at least I could not figure out how to use it as such.
Non value line parts (read- non dip msp430s) offer Timer B, which can have as many as 7 CCRs. Finding these parts are difficult as TI does not provide a search function based on number of CCR registers per timer. These would work great. Alternatively you can pick up a value line msp that has two timer As, and is thus capable of 4 hardware PWM signals. This just means a few extra lines of initialization code and keeping track of what color is on what timer. The timers count’s will not be synchronized but this is irrelevant.
I used the MSP430g2553, free from TI via samples here: g2553
There are a few things to configure to your liking. The period and the maximum duty cycle (to prevent burning out LEDs). The period ultumatly sets the PWM frequency. The two Timer As are running off of the DCO at 16Mhz. They will continuosly count up to the period -1 and reset to zero. This alone will do nothing. Each color has a CCR to tell the hardware when to do something. This something is configured in a separate control register, which tells it what to do. In this case it is OUTMOD_7, which changes the pins state at every time the timer = the CCR value. Setting the period to 320 sets the timer frequency to 50Khz, and thus the PWM frequency to the same. Setting a CCR register to 120 would then give you a 50% duty cycle on the corresponding pin. See below for the sample code. The whole code composer project is zipped in there….have fun.