thanks for letting me know , mark ! i was wondering why some of the postings i read were distorted. opto's are quite $$$ . space is a factor , i was going to use 2 diodes +res ac---------|>-----| res 240v |------/\/\/\-----|rb3 (values for 240v) ac---------|>-----| 10m i've tested this out on 16vac (res lower value)while i get the code working righ t.had no probs.with sync. the prob was pullups (set pullups does all portb pins) when pullups are used to get switch values the pullup on rb3 is at 1.8v & can't detect zero crossing. once the sw val.is selected (which is on powerup) i just remove pullups ,everyth ing ok then. thankyou very much for your time & advice glen ps if i was after better accuracy ,yeh i'd look at opto ************************** Mark Jurras wrote: > Glen, > > When posting code and schematics use a fixed width font such as Courier. Every computer has a > fixed width font. You posting was some variable spaced font that was different spacing than any > variable spaced font that I and many others have. It was difficult to read. > > I would use an opto-isolator on AC signal to generate the sync pulses. That wa y all the PIC inputs > would be at VCC levels and you get around all the internal diode conduction pr oblems that others > with better knowledge of the PIC can tell you about when you feed with HV on t he inputs. > > HTH, > > - -Mark > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com