> > In light of this discussion, I have two questions. > > (1) How would I get a PIC to interface with the A/C (120V) line > frequency? > > (2) If I have A/C anyway, is there a inexpensive way (i.e. less than > the cost of a AC/DC adapter) to convert A/C to a DC in the PIC > operating voltage? > > -Edwin > > > ______________________________ Reply Separator _________________________________ > > Don't overlook line frequency as a good long term standard. Utilities > keep an awfully good average frequency so that there aren't any problems > with synchronization in the power grid. > > -- Tom > One of the application notes (don't have the handbook here) is about AC line interfacing. The easiest way to do it is just to directly connect the AC line through a very large (1Mohm sticks in my head, but you should check the note) to an input pin. The voltage on this pin will of course rise much higher than Vdd, but the internal protection diodes on the pin will do a nice job of draining off the excessive voltage without damage. You then use the value of the pin as a zero-crossing detector. This can be done to clock line frequency or to fire triacs, etc. As far as building your own power supply for the PIC, you will need a small transformer which takes 120VAC and outputs something on the order of 10VAC (exact voltage not critical) and then you need a rectifier, a capacitor or two to smooth out the ripple, and a voltage regulator. -ben -- Benjamin A. Tober - -WBRS FM - 100.1Mhz in Waltham,Ma. email: tober@cs.brandeis.edu -FreeLiveMusic Four Times Weekly "Are you a truck?" -24hr/day all-genre diversity