I did something similar for a light dimming system, only there I had to take the nonlinearity of the perceived brightness vs RMS voltage into account along with the time delay into a cycle vs RMS voltage. I ended up using the shareware Calculus Calculator to make a 7th order Taylor series to do the brightness (DMX) code to RMS voltage, then the standard RMS calculation (square root of the mean of the squares of the instantaneous voltages, the mean calculated using the integral over the time of a half cycle) for the portion of the cycle the power was on to determine the RMS voltage for various firing angles. These two equations functions for RMS voltage were set equal to each other, then the Calculus Calculator set to work to solve it, giving a time delay for each DMX value. Finally, the General Electric Thyristor Handbook (at work, I'm at home) has a formula relating firing angle to RMS voltage. I'll see if I can dig it up next time I'm in there. In our application, we used a 256 entry table (actually two tables, one returns the high byte, the other returns the low byte) to take the incoming code and convert it into timer clicks. We reset the timer on zero-crossings and then used the capture/compare register to generate an interrupt where we then turned on the triac. You can see the finished product (the DM406 Shoebox dimmer) at http://www.dovesystems.com Harold