Yes, you can do it with the RB0/INT pin. I did this on the DM406 at http://www.dovesystems.com . Here we add a second pair of diodes on the secondary of the power transformer (the first pair of diodes are doing a full wave rectification with the center tap of the transformer secondary grounded). The two cathodes of this second pair of diodes are tied together with a pull-down resistor to ground. Then a current limit resistor to the RB0 pin. Set that pin to generate an interrupt on a negative edge. It will interrupt a little before the zero crossing. Be careful with internal pull-ups on port B, as the current limit resistor and the pull-down have to be small enough to pull the pin down. I'd now probably turn off internal pull-ups and use an external pull-up on pins that needed one (not the INT pin). It'd be nice if Microchip made the internal pull-up be driven by the output latch so it could be enabled pin by pin. Once the zero cross generates an interrupt, we reset a timer and use the capture/compare register to generate another interrupt to turn on triacs at the appropriate time. Harold On Tue, 6 Nov 2001 10:14:32 -0600 David Dunn writes: > I'm sure in my surfing i've seen that you can do a zero crossing > detector on a pic, possibly with PB0 ? I'm using a 16F877. > > Anybody have links on how to set this up ? > > > Thanks, > > DLD > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > FCC Rules Online at http://hallikainen.com/FccRules Lighting control for theatre and television at http://www.dovesystems.com ________________________________________________________________ GET INTERNET ACCESS FROM JUNO! Juno offers FREE or PREMIUM Internet access for less! Join Juno today! For your FREE software, visit: http://dl.www.juno.com/get/web/. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body