On Thu, 27 Mar 1997 13:15:44 -0800 "Aaron J. Miller" writes: >Hello all, > >This question is only marginally related to pic's since I am going to >use >a 16C84 to control the chopper, but there seem to be quite a few >bright >people out there who may be able to help... > >I am trying to make an incandescent lamp dimmer from a 16C84 and >planned >on doing a simple waveform chop using a triac. I realized, however, >that >since the pic is going to be doing a bunch of other time sensitive >stuff >that I don't have the processor time to manually sense the zero and >chop >the wave using the pic. > >So, is there any easy method to passively (from the pic's point of >view) >chop the AC wave? i.e. use 8 I/O pins to a D-A to give a reference to >the >chopper circuit and have it do the rest? That way I can just output >the >light level to the pins and it would stay put leaving the rest of the >processor available? > We are using the 16c74 to phase control four triacs. We detect zero cross by doing a negative edge interrupt on the external interrupt pin. Positive zero cross is determined based on a timer. We determine when to turn on a triac by using the compare mode of a capture/compare timer register. At zerocross we determine when the first turn-on will be, then put it in the compare register. On receiving the interrupt from that compare, we turn on that triac and load the next. The external interrupt port pin is driven directly from the power supply transformer secondary with a series current limit resistor. The clamp diodes in the 16c74 square it nicely and the hysteresis on the input prevents noise problems. Note that we actually get the interrupt a little BEFORE the zero-cross, but that's a lot better than a lot after (which would be the case on a positive edge trigger). A 16c74 running at 16 MHz handles this quite nicely. While doing the phase control it is also receiving a 250 Kbps datastream and scanning 4 A/D inputs. If you want to generate triac firing externally, you can do it with an op-amp ramp generator (that is synced with the AC line) driving a comparator for each triac. You can get analog output of many of the PICs by using pwm into a simple low pass filter. We're doing something similar in a product where we take the 250 Kbps datastream and pull out 48 bytes, converting them to analog signals. Now... speaking of AC choppers... Anyone aware of a bunch of PWM generators (like those in PIC chips) but all in one chip (maybe a dozen of them or so that could be driven by SPI or I2C)? Harold