...not that it's made me any less late.
So there I was, scrounging in the back room of LEES when I came across a 120V Weston Voltmeter. 120V, twelve hours... coincidence? I think not.
This was the first clock I built, but I've since built a couple others, a single-digit NIXIE and a CRT clock, so the whole count-60-cycles seems like old hat at this point. The PIC sits there interrupting on RA4/T0CKI and dutifully keeping count of those oh-so-accurate (at least, over long periods of time) cycles coming out of the wall.
To get that into an analog voltage, we use the PIC16F628's hardware PWM output into an RC lowpass filter, through our handily constructed high-voltage op-amp, and into the trusty Weston Voltmeter (dating back to 1894 or thereabouts, according to the patent markings on ithow hot is that?).
...is the only interesting part of the whole thing. The common-base lets us level shift the output of the LF356 into the common emitter, which drives a follower to supply current for the whole thing. The .1μF and 1μF caps compensate the loop (which needs it given the two additional gain stages inside the loop with the op-amp). Probably the most important element in the whole shebang is the 51Ω resistor, which prevents the follower from looking like a negative (real!) resistance when loaded with the reasonably large capacitance of the voltmeter. If that's not there, or not big enough, the sumbitch will oscillate at a few tens or hundreds of mega-Hertz. Deriving the conditions under which the real part of the input impedance to a capacitively-loaded emitter follower looks negative is left as an exercise to the reader.
When the CALIB input is asserted, the PWM output is set at its maximum value, allowing the user to adjust the gain via the 20kΩ pot.
So, lessee here. You'll probably want the code. It's written in jal, but most of it is just assembler (don't ask why I didn't just use gpasmthe answer is there isn't an answer). In addition to the standard jal crap, you'll need intrh.jal and clock.jal (or, if you're not interested in looking at what I think passes for coding, clock.hex). (Either way, note that the code is distributed under the terms of the GNU GPL.) To the right is the schematic in its entirety. You'll need a transformer for the 5V stuff, and, if you're sane, one for the 120V stuff as well (mine doesn't have one).
I'll give y'all my layout, but I'll admit that I had to hack on mine enough that the gerber files aren't the same ones that I actually had fabbed (by 4pcb, of course), though they reflect all of the changes I had to make to mine. I believe this board should just work as is.