On Sun, 10 May 1998 16:53:43 EDT FScalini writes: >I've seen zero crossing detection of AC currents come up frequently on >this >list lately, especially with respect to dimming applications. What is >the >practicality of zero crossing detection? > Works well! In the Shoebox dimmer (at http://www.dovesystems.com), I have a 10K resistor from the power transformer secondary to the INT pin on a 16c74a. The chip generates an INT on the negative edge (which is just before zero crossing). The INT then resets a timer and the number of clock ticks into the half cycle we want to turn on the first lamp (the brightest) is loaded into the capture-compare register. The CCP then generates an interrupt, turning on the appropriate triac and reloading the CCP with the next brightest lamp. After the last lamp is turned on, the CCP is loaded with a number corresponding to the length of a half-cycle. When this interrupt occurs, the timer is reset and the brightest lamp value put in the CCP, since we are then at the positive zero-crossing. Note that I only detect the negative zero-crossing. The INT input is a schmitt input that has its trigger points somewhere around 2 and 3 volts. If we generate an interrupt based on a positive edge, this would be AFTER the zero-crossing. That doesn't do much good in controlling triacs. Therefore, I used the negative edge and timed to the positive zero crossing. On three phase systems, it gets more complicated. Since we probably don't want the expense of three power transformers, we use opto couplers like the H11AA1. This could be used to drive the INT input on three PICs, like above, but that gets a little expensive. The design I'm currently working on uses a PIC to decode 24 channels of DMX out to 0 to 5 volt analog (using the PWM output), then putting this into analog comparators driven by analog ramps that are synchronized with three phases of power line zero-crossing. Harold _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]