Code is written for a 14-pin 16F688 using the internal 8 MHz oscillator.

It receives DMX-512 and outputs 3 channels of PWM at a nearly 100 Hz refresh rate. Resolution is 8 bits minus 1, or 255 discrete states. PWM data comes from three consecutive DMX channels, and the start address can be set at compile time.

No crystal required! The internal PLL module in the EUSART oversamples the incoming serial data string at a high enough rate that the reception is very, very stable.

I tried like crazy to make this all work in PicBasic Pro, but even using assembly interrupts the timing wasn't working out. The PWM routine needs a 40 uS tick and it was just taking too long (even with an assembly interrupt routine) to get things done smoothly.

Nice thing is that it compiles to just a few hundred words. The chip has 4K of space, so there's lots of room for expansion.

This is my first-ever 100% assembly program, so there may be some rough edges in the code.

Source code, schematics & more can be found here:

http://www.response-box.com/rgblights

Comments and suggestions are always appreciated.

- JEC