I am working on a design for a two channel AC dimmer using a PIC (16F87x series). Just wondering if anyone else has done it. I am running into a timing issue =96 or rather a like of timing issue. Here are my thoughts: Input to the dimmer would be either a 0-5vdc voltage, or a command via the RS232 input. The dimmer would have 256 steps between full on and off. Also, I would like to linearize the output, rather than the common strong start, linear in the middle and tapers off at the end. To do this, I though that I would have a circuit tied to the 60Hz line that would provide when a zero crossing takes place. This would start a counter based on T1 =96 this counter would count up to 256 during =BD cycle of 60Hz wave. A look up ta= ble would be used to compare the current analog value (or command value) to the linearized value at that slice of time (1 of the 256 slices in =BD of a 60Hz wave). When the current analog value exceeds the look up table value then the AC output would be activated. At the end of the =BD cycle the process would start over. Now for the problem =96 A 60Hz wave has a period of 16.66ms, so half a wave would be 8.33ms. If we divide this time into 256 slices that would give us 32.5 us per slice. A PIC16F87x running at 20MHz can perform an instruction in 200ns. So at 200ns/per instruction we could perform 162 instructions in 32.5us. This is not enough time to go through all 255 steps in the look up table. I could reduce the steps to 7 bits (128 steps) and this would possibly give me enough time for the look up table, but no much else. So as I said =96 anyone else already been through this that can possibly gu= ide me in a better method? I am trying to hold external hardware down to a minimum. Thanks, David David V. Fansler S/V Annabelle david@dv-fansler.com www.dv-fansler.com -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist