Sunday, January 2, 2011

2-tube regenerative receiver

I built this regenerative receiver in the summer of 2010 after Dayton.  I'd built a simple transistor regen previously, but wanted to try a more serious version using tubes.  Calling it a 2-tube receiver is a little misleading since the two tubes are dual section types (tetrode and triode).  So it's more like a 4-tube radio.  This allows some isolation between the antenna and the regen stage and from detector to audio stages.
The design is by David Newkirk WJ1Z and appears in the September 1992 QST and in the ARRL book "QRP Power". I used the suggested method of obtaining B+ by connecting a couple of 240 to 24 VAC transformers back to back. This gave me 120 volts to 12 volts and back to 120 volts, but now isolated from ground (house system neutral), which is why you do this. I wound up with 110 VDC B+, a little low because my transfomers designed for 240 VAC but used at 120 VAC have more impedance than a 120 VAC transformer would.  No big deal.  Also the clever regulator using a neon bulb wouldn't work because it doesn't fire that low.  But I found that it wasn't needed as my voltage was steady.  I used a separate 120 to 12 volt transformer for the filaments.
I didn't make many changes from the design of the article, the main one change being the tuning range.  The design is for about a 2 MHz range to include some SW BC plus 40 meters.  I wasn't interested in SW BC and wanted the better tuning rate and better stability I'd get by restricting the range.  I changed the frequency determining capacitors to give me a range of 6900 kHz to 7350 kHz. The main tuning is reasonably smooth and the fine / bandspread tuning allows getting the desired note on CW and tuning in understandable SSB.
The claims made in the article proved to be accurate.  I don't see any hand capacity effects and the regeneration control is smooth.  There's a little more stuff to fiddle with, but really the use of this receiver is not much more fussy than that of the S-40A sitting behind it as I write this.  The RF attenuator at the input is quite useful when overly strong signals tend to make the signal "tear" or "block", if you know what I mean.  Just back off on the RF control and everything is fine again.  I find that I can pretty much "set and forget" the regen control, although optimizing for selectivity and sensitivity might be useful for weak signal work.
I built the receiver on a big chassis to give me plenty of room and I'm glad I did that.  I did have some issues with stability and microphonics initially, before I narrowed the tuning range.  I also put the tank toroid and several associated capacitors on a perf board and rigidly mounted it, plus made some connecting wiring in the frequency determining areas more heavy and provided more sturdy mounting points. Also "potted" the toroid with hot glue. All that helped a great deal.
I considered adding another tube so I'd have enough audio to drive a speaker.  But it drives my modern low-Z phones really well and if I want a speaker, I plug in some totally incongruous little powered MP3 / cell phone speakers by LG which do a great job.
The white triangles around the main tuning knob indicate 50 kHz steps from 7000 up.  I've replaced them with slightly less ugly but definitely less ambiguous labels showing 50 kHz points from 7000 through 7250 kHz.
There you have it - another project to check off my list: a tube type, good performing regenerative receiver.

Nick, WA5BDU
January 2, 2011

I got an actual comment (!) suggesting a photo of the wiring under the chassis would be useful.  I'd considered that initially and now I'm going to add one-


There you have it.  Of interest, I think is the little perf board left of the fine tuning capacitor.  I added this to stabilize things.  It's mounted solidly with four standoffs, not something I'd normally do.  It contains the toroid and several frequency range setting caps including one trimmer.  Note heavy wire leaving this board to solid tie points also added in the interest of stability. The main tuning capacitor is smaller than the one for fine tuning and is visible above the perf board.
Otherwise, the schematic was interesting with it's use of multiple stages of R-C filtering in the B+ and screen voltage sections.  So you see lots of electrolytics.  Center left is the "70 volt" audio transformer used to match audio amplifier section down to modern, relatively low impedance phones or earbuds. In the lower right corner is the input or antenna trimmer capacitor and its associated ferrite toroid inductor just inward from it. The capacitor is screw adjusted from the top side through a hole.  It's pretty much set and forget though, so didn't need to be accessible.

Thursday, April 22, 2010

RF output current meter for QRP TX


My latest project has been a two-tube crystal controlled 5 watt transmitter. (I wound up with 4 watts.)  But I'm not ready to describe it yet so I'll just talk about the metering.  Initially I was going to use the technique of putting an incandescent lamp in series with the final amplifier plate supply and tune for minimum to indicate resonance.
I noticed that using the plate current indication lamp on the tube TX wasn’t effective at all in tuning for maximum output power.  There was not a good sharp dip.  So I decided to try measuring the output current at the antenna jack and tuning for maximum.
Four watts is about 285 mA rms or 20 volts peak into 50 ohms.  I used an FT50-43 core with 23 turns on it for a 23:1 current reduction.  First I wanted to use an LED indicator.  A problem is that after a couple mA of current, it’s hard to detect any further increase in brightness.  So I needed to scale my current.  I put a 100 ohm pot in series with 200 ohms fixed as a shunt.  The 200 ohms is for a “zero” threshold to get the LED to turn on and the pot is a sensitivity control.  I also had a 0.22 uF capacitor across the output.  The transformer secondary goes through a 1N914 to the positive “bus” output which goes to the LED, capacitor, and sensitivity control / shunt.  I tried it on the rig but didn’t like it.  Too hard to see the peak output.  I might get 3 to 3.5 watts out using the LED but by using the watt meter I could fine tune to 4 watts.
I’d been modeling all this on LTSpice.  I decided to use a junkbox 300 uA horizontal meter with 845 ohms of resistance.  I found that about a 25 ohm shunt would do the job so I bypassed the 200 ohm resistor.  I’d hoped not to use a meter since mounting them is a pain.  I’m not about to cut a hole to fit the meter so I’ll use some ugly method.
Another thing I considered was to have the DC voltage from my detector drive an incandescent bulb using an amplifier, probably a transistor, as some sort of DC current amp. I’d tune for maximum brightness.  I think an incandescent would work better than an LED for this purpose. But then I’d need a DC supply, etc.  So meter it is.  The circuit is trivial, but here it is -


Saturday, March 27, 2010

Measuring high resistances with a MOSFET

There was a discussion on the Elecraft list about those static charge dissipating grounding mats used for electronic construction, and what kind of resistance might or should be seen between two points on such a surface.  The fact is, it can be in the hundreds or thousands of megohms or higher and so is beyond the measurement range of a typical DMM.  (My best DMM has a 2000M-ohm scale, higher than I expected but still too low.)
Anyway, it put me in mind of an experiment I'd done a while ago to measure how long a capacitor could hold a charge.  With a high quality capacitor it's difficult to do because a typical 10 M-ohm voltmeter will drain the voltage off in short order.  So the trick is to connect the capacitor to the gate of a MOSFET, which has extremely high resistance, and charge the capacitor and put the voltmeter on the drain side of the MOSFET.
The effect on the drain circuit is hardly linear, but there's a sharp transition where the MOSFET comes out of saturation as the capacitor eventually charges toward zero volts.  You can measure that transition gate voltage before hand and when the drain voltage rises to a certain reference point, you're there.
I was surprised at how long a certain film (I think) 0.22 uF capacitor held a charge.  It had gone about four days when I accidentally discharged it, so even now I'm not sure. After that I tried an ordinary 0.1 uf ceramic disk and it held its charge for two days.
OK, so I know the self-discharge rate of the 0.22 uF capacitor was very slow, so I could use it to test large resistances and assume essentially all of the discharge was due to the external resistance.  My circuit is simple enough to describe in words.  A resistor, say 20k, from +12.7 VDC battery to the drain of the 2N7000 MOSFET.  The source goes to ground.  The gate goes to the capacitor and the other end of the capacitor goes to ground. The external resistance being "measured" goes from gate to ground, in parallel with the capacitor.
The MOSFET's channel is ON when the gate voltage goes positive and OFF when gate voltage is zero.  So I measured that from a range of 10 V to about 2.25 V gate voltage, the MOSFET was fully on and drain voltage was near zero.  Below 2.25 V gate voltage, the drain voltage started to rise and was at 8 V with 1.92  V on the gate and 12.5 V with 1.52 V on the gate.  So when I see somewhere from 8 to 12 V on the drain, I know the capacitor has discharged to 1.5 to 2 VDC.
I set up a spreadsheet to figure resistance from V-initial, V-final, C and time 't', in seconds.  Its uses the equation
  R = -t / (C*ln(Vf / Vi))

Experiments


Turns out I don't actually have one of those anti-static pads but I do have some other stuff I wondered about. For one, those black foam rectangles you see ICs embedded in or affixed to, in the case of SMT.  Another material is those shiny semi-transparent envelopes that the stuff we buy from Mouser or Digi-Key comes packed in.
I took a chunk of the black stuff, that used by AD to pack an AD9851 DDS chip in and stuck #18 solid wire electrodes in it lengthwise, about 1 inch apart and 1.5 inches deep and connected that across my capacitor.  Connected the battery and then used a separate supply  to charge the 0.22 uF capacitor to 10 VDC, at which time the drain voltage jumped from 12.5 VDC to 0 VDC.  It took about 3 hours and 15 minutes for the voltage to start climbing and it quickly reached 11.8 VDC at 3 hours, 22 minutes.  I inferred a gate voltage of ~1.85 volts from my earlier characterization of the 2N7000 and my spreadsheet spit out a value of 3.26E10 ohms, or 32.6 G-ohms between those electrodes.
Next I took one of those anti-static envelopes and inserted a couple pieces of circuit board material, about 1x2 inches as electrodes, spacing their long sides about 1/4 inch apart.  So the conduction path is more or less across that 1/4 inch.  I set a couple pieces of non-conductive "stuff" on top of the envelope to increase the contact area and started the timing thing again.  This time it took 25 minutes & 22 seconds for the capacitor to discharge to the "threshold" region of about 1.9 V on the gate.  The calculated resistance was 4.2E9 or 4.2 G-ohms.  About one tenth of the reading with the black foam.
But it was interesting that I checked out a couple of other pieces of black spongy foam and measured resistances in the kilohms with my DMM, far too low to require my method.
My final experiment was a "control" test.  The biggest resistor I have is marked 66 M-ohms at 10% tolerance.  I connected it to the gizmo and saw the drain voltage quickly transition at 24 seconds.  Spreadsheet says, 67.8 M-ohms.  So I think the accuracy is pretty good.

In the interest of scientific rigor, I should say that I just arbitrarily measured the resistance between two points, or two electrodes.  If I were being rigorous, I would have made things more complicated and attempted to measure volume or surface resistivity of the material.  But my intent was just to answer the question, "I wonder what the resistance is between these two electrodes in or on this anti-static material?"

BTW, the 0.22 uF capacitor was just what I pulled out of the box.  To keep the times from being excessively long, a capacitor an order of magnitude or so smaller would be a good idea, after verifying that its self discharge rate is appropriately long.


Nick, WA5BDU
3/27/2010

Here's an edit.  It was suggested that a schematic would be a good idea, however simple this thing may be.  I guess that's true:


So there's one.  I charged C1 to 10 V to start the measurement, but there's no reason you couldn't just touch the battery positive to it to charge it.  As long as you know the initial and final voltages, you're good.  Another option would be to charge C1 to a value of the final target "threshold" voltage divided by 0.37.  Since a capacitor will discharge to 37% of its initial voltage in one time constant, it simplifies the math of finding Rx.  Like this -

tau = RC           (tau is one time constant)

so, R = tau / C

3/28/2010

Saturday, February 27, 2010

2-meter FM receiver with MC3362 chip and Si570 synthesizer


I discussed the Si570 and controlling it with my Arduino in an earlier post.  The fact that it can reach 160 MHz made me think of using it for 2 meters (146 MHz).  I tried to homebrew a 2-meter FM rig back around 1979 / 1980 with limited success and always wanted to give it another shot.  Plus, I've seen many articles about using the various integrated radio chips for ham use and was intrigued.  Most of the articles diverted the VHF / FM chips for usage on HF receiving CW and/or SSB.  That sounds great, but I wanted to try one in its "native" mode first.

The MC3362 isn't a car radio chip, as I'd thought at first.  It was intended for 49.7 MHz FM (was that toy walkie-talkies?  Or cordless phones?) and ~160 MHz weather receivers and even for ham radio.

Rather than describe all the details here, I'll link to my web page, which seems better suited for such things -


And I want to include the link to my schematic in JPG format -


Yeah, it works.  Sounds pretty good.  Now if I could just come up with a companion transmitter, I'll have finished that 1979 project at last.

Right now I'm working on a crystal oscillator 1st LO so I can make it independent of the Si570, although limited to frequencies I have crystals for.


Sunday, November 1, 2009

No-DDS DDS





A DDS using a PIC and a DAC chip ...

First, I apologize for having all the pictures piled up at the top. Someday I'll figure out how to insert them at the proper locations in the flow of the text.

Frequency synthesizers using the DDS (Direct Digital Synthesis) technique are lots of fun and I’ve built, let’s see … , four of them as stand-alone boards. I thought it would be fun to build one not by using an integrated DDS chip, but rather by using a microcontroller (PIC) and a DAC chip. Obviously I wouldn’t be achieving RF speeds, but this is just for the learning experience.

How does a DDS work?

Let’s start with the output device, which is a DAC or digital to analog converter. It takes as input a binary number with a maximum value depending on the number of bits and outputs a voltage proportional to that number. In my case it’s an 8 bit number having a range of 0 to 255, so my DAC has an output range of 256 discrete voltages in equal steps.

Within my PIC’s program, here’s the task at hand: The program runs in a loop that sends the proper voltage info (0 to 255) to the DAC each time through. One run through the loop always takes the same amount of time, 4 microseconds in my case. I want to produce a sine wave of a specified frequency. So I need to know, for each 4 microsecond advance in time, where I am in the 360 degree period of a sine wave of the desired frequency. Knowing that, I can look up the closest value of the sine wave in a table (there’s not enough time to calculate it) and put that out to the DAC. This is how any frequency up to the upper limit can be generated even though the loop is outputting numbers at a constant rate.

That upper limit is the based on sampling theory which says that with a minimum of two samples per cycle, the sine wave can be recovered. In practice a bit more than two is considered the actual limit. With my 4 u-sec loop time, I’d need 8 u-sec to send out two samples and my theoretical limit would be 1/8E-6 or 125,000 Hz.

Cutting to the chase on the mechanics of this thing … I need a number called the Phase Increment which I call “PI”. It’s how much the phase angle of the sine wave advances with each trip through the loop in the PIC. (Don’t confuse it with pi = 3.14159 …)

The data (for a sine wave) is a 256 sample look-up table. Therefore, 256 = 360 degrees. For greater accuracy, 24 bits are used to allow a high precision phase increment.

The frequency of operation for the DDS is

f = PI*fclock/2^24 where fclock is the effective "frequency" of the program loop which is 1/T, where T is the time it takes to execute it, or 250,000 Hz in my case.

So, PI = f*2^24/fclock

I have to use the above to calculate a new PI every time I change the DDS output frequency. The PI is added to a phase accumulator in each passage through the loop. Since there are only 256 samples, only the most significant byte is examined to point to a sample in the table. Consider my 24-bit phase accumulator to be an integer plus fraction where the high byte (MSD) represents a full cycle (360 degrees) and the other 16 bits are fractional parts of a cycle.

To write the DDS loop, I need a 3-byte accumulator and a 3-byte PI. Calculation of the PI is done outside the loop, so assume it's known. Here's what the main loop does:

  • Add the PI to the accumulator. The MSD will be the current phase angle of the sine wave to 8-bit accuracy. (MSD is the most significant digit, also known as the high byte of the 24-bit number.)
  • Take the MSD of the accumulator and use it to look up the corresponding value of the sine wave in a table.
  • Put that value out to the DAC
  • Repeat

So the only bit of information supplied from outside the loop is the PI. When the external control routines want to change the frequency of the DDS, it just alters the PI.

Hardware details -

I decided to use a DAC chip I have in my junkbox, which is an AD7530 10-bit ADC. ($1.35 from B.G. Micro.) I'll tie the two highest bits to ground and my maximum output will be 1/4th of what it would be using all bits. Yes, I had enough bits in my calculation to use all 10, but that would make my update routine take longer and lower my maximum frequency.

I wasn’t sure how to apply this chip. The data sheet shows using an inverting op-amp on the output, which it appears is really necessary. This means I need a negative supply, unfortunately. Plus the chip needs +15V to power it. So now I need +15V, +5V (PIC) and negative for Vref. Vref can be positive or negative, but since the op-amp inverts it, I'm going with negative so I'll have a positive output. I'll also us the negative Vref on the negative op-amp supply so I won't require a rail-to-rail op-amp to get to 0 volts.

For the negative supply, I took a wall wart rated 9V at 200mA which puts out 14.5 V no load. Took that through 200W to a 10 V zener to get about -9.79 volts as a reference. Experimenting on a breadboard, I get +2.45 volts out with all 8 lines high, close to the expected value. The step is about 10 mV per bit. My op-amp is currently a 4558. It's GBP is over 3 MHz, but open loop gain goes from 100 dB at low frequency down to 30 dB at 100,000 Hz, so I'm not sure if it's fast enough or not.

The 2.45 volt maximum output might need a little boost, so I could use the other half of the 4558 for that, with a gain of 2.

I'll add a photo of the board here ...

Well, guess I can't add it here. Everything goes to the top it seems.

Schematic -

Which is no doubt going to happen to the schematic when I add it too ... I keep reading the "help" on this Google Blogger thing but it's not much help to me. But it's free and it works, to a degree.

Anyway, the schematic is in here somewhere. Mostly it's a connection diagram, but some details are presented in schematic form.

One of my favorite parts isn't part of the No-DDS at all but is the RS-232 to TTL interface. This is the two 2N7000 MOSFET circuits shown at the bottom. I've fooled with a lot of level translation circuits, especially the MAX232 chips and that family. I like this one because it uses a two dime active devices and two resistors and takes less connections than a MAX232, though to be fair, the chip does two conversions in each direction. One drawback of the circuit is that the signal out to the RS232 device doesn't go negative. Maybe I could have made that happen in the No-DDS circuit, since I do have negative voltage available.

Controlling it - the PC software interface ...

I needed a way to tell the PIC what frequency to generate, so I altered an old piece of DOS software I'd written earlier. A slight problem was in how to get the PIC's attention. The update loop needs to be as tight as possible, so it can't afford to poll for external input. The logical thing then is to use an interrupt. But I discovered that all the lines that were interrupt capable, I'd already used for I/O with the DAC. So I wondered if using the -MCLR line would work. This effectively forces the PIC to re-boot every time that line is actuated. It turned out to work OK. When the PC software wants to get the PIC's attention, it bangs the -MCLR line. The PIC restarts and part of the start-up code is for it to check its serial port for incoming data. That data will be the new PI, which will be stored before the PIC goes permanently (until the next restart) into the update loop.

I'm putting in a picture of the DOS screen. Some of the fields aren't used, since this program was developed to control full featured RF DDSs that were used as VFOs. I wrote this program in 8088/8086 assembly language using the A86 shareware assembler.

Conclusions

It worked pretty well. That rope-like waveform appearance was due to my scope acting up a bit. Like the 1-bit sine generator, I built this thing but am not sure why. I think I thought it would be fun, and I guess it sort of was. I combined a little electronics, a little PIC programming, and a little PC programming to produce a circuit that worked as imagined.

-Nick




Thursday, October 1, 2009

1-bit PIC sine wave generator
































Above is the digitally synthesized sine wave.

This is one of those “because I can” projects. Can I generate a sine wave using a simple PIC employing no PWM and no DAC, no software timers or interrupts, just turning an output pin on and off? We all know it can be done because our music players boast of the 1-bit DACs inside.

Simplistically, we know if our output pin puts out 5 volts when ON and 0 volts when OFF, a 50% duty cycle should give us an average output voltage of 2.5. But the actual method is a little cleverer than that, which is what makes it fun. I picked it up from Glen Leinweber, VE3DNL, a great ham tinkerer in the realms of RF and programming.
The sequence of ones and zeroes is first calculated “off line” using a simple program in a high level language, QBASIC in my case. Variables track the integral under the sine (actually cosine in my case) curve and the integrated value of all the bits generated previously. If the value of the integrated bits is less than that of the cosine curve, the next bit is made a 1 and if it is more, the next bit is a 0. In this way, the average value of the bit stream is tracking the value of the cosine wave as closely as possible. Glen says this technique is an example of something called “sigma-delta coding”.
There are some practical considerations related to our MCU chip, a 12F629 in my case. My processor is running at 1 MHz and it can toggle my output pin in one execution cycle or 1 microsecond. Naturally, I want my bits as narrow as possible for fine resolution. The limitation is on the amount of program memory I have, which is 1024 bytes for the 12F629. The program will simply output all the bits for one cycle and then repeat. So the period of the cycle determines the program’s length. Say I wanted a 1,000 Hz output. The period is 1 millisecond, so I’d need roughly 1,000 instructions plus a little overhead. You can see that lower pitched tones require more memory as their period is longer.
I wanted to do an “A” musical note at 440 Hz but it wouldn’t fit so I wound up at “D” (587 Hz). Even this wouldn’t fit without a little trickery since its period is 1,703 microseconds. Turns out that there are long streams of 1s or 0s where the sine wave is at its positive and negative peaks. So I can save memory by calling delay routines repetitively. Actually, one routine with multiple entry points is even better.
Want to write a ~1000 line program by staring at a printout of 1,703 ones and zeros and writing the code to produce them? Me neither. So my QBASIC program also gets to write the bulk of the source code. After the bit sequence is stored in an array, the program then examines it for repeats and writes the code to implement the bit sequence efficiently.
I also wanted a way to turn the output on or off in response to user input (telegraph key?) on another pin. To do this, I just wrote the code to sense the pin and if its state tells me to turn the sound off, I configure the output pin to be an input instead of an output. Each time through the code, it reads the control pin and configures the output pin accordingly. The sound generating code continues to run as always. I had to count the number of cycles this code took and then insert it in place of an equal number of “time wasting” cycles in an area where the output pin is not changing.
OK, say I get it running. How do I look at the output and verify that I’ve achieved my goal? If I just look at the output pin with my o’scope, I’ll see a pulse train of varying density. So just as I did in software, I have to integrate the pulse train in hardware by connecting a resistor and capacitor to the pin. Here’s the tricky part: the R/C network is a low pass filter, and with enough filtering even a square wave can be turned into a perfect sine. So to make sure I’m not “cheating”, I make sure the corner frequency of my filter is much higher than my fundamental frequency. The proof is in the pictures, with a shot of several cycles showing a nice sine wave, but a close-in zoom of part of the cycles show the jaggies caused by the individual bit transitions.




In this "magnified" view, you can see the jaggies that betray the sine wave's digital origin


A fun variation might be to do a more complex waveform – say the sum of sine waves of 1,000 Hz and 1,500 Hz. The period would be that of the difference frequency, 500 Hz and the resultant would be something you couldn’t fake with low pass filtering. Combining two musically related notes would be even better – easier on the ears.
One more relevant bit of info. Most PICs these days include high speed and fairly accurate internal oscillators you can use and save the price of a crystal and two I/O pins. The thing is pretty accurate, but has frequency trimming registers if you want to get closer. My ‘D’ note started off 8 Hz low with the factory value and I was able to trim it to within 1 Hz.
What’s it good for? Don’t you hate that question? But I guess it’s a stable audio sine wave source for the price ($2 or so?) of a simple PIC chip. Not too flexible though – to change the frequency you have to re-run your QBASIC program to generate revised source code and then re-program the chip.
Update: I decided I should make my PIC program and my QBASIC program accessible, which was easier to do on my web page than in this blog. So go to my site using this link and near (or at) the bottom of the table of stuff is the link to my 1-bit sine page. Scroll down through all the text you've already seen and you see the links to the two files.








Sunday, September 27, 2009

My Nixie Clock


I bought a digital volt-ohm meter for $5 at a ham flea market years ago. It is probably about 1970 vintage and uses old fashioned Nixie display tubes. These tubes have long since been replaced with 7-segment LEDs and then LCDs, and then pixel based LCDs.

Nixies are a favorite among hobbyists who like archaic parts because of the visual appeal of the display. Each numeral is individually "drawn" from a gas discharge tube, rather than being crudely constructed from segments or dots. The VOM has three Nixie tubes with 0-9 plus decimal point, plus a single neon tube for the MSD (1 or off). So it is a 3-1/2 digit device with range from 0000 to 1999.

A. Hardware approach ...

Plan 1 was to let the PIC generate a DC voltage equivalent to the time in millivolts, for example 10:35 is 1035mV, and input that to the meter. The PIC would use its PWM module to generate voltages. Unfortunately, the PWM is only 10 bits, a resolution of one part in 1024. I need one part in 1259 so I couldn't be accurate right to the minute. Also there would be some accuracy issues resulting in a little uncertainty in the 1's minute digit. The advantage would be that there would be no modification to the VOM at all.

Plan 2 required investigating how the VOM works. I could have the PIC put BCD data right to the three Nixie driver chips (if I have their data), but it might be nice to have an easier way that doesn't require 12 data lines and cutting a bunch of traces.

Each Nixie has three chips in front of it. First is a 7441B Nixie driver, fairly standard. Next is a SN7075N and behind it is a SN7090N. Probably TTL chips 7475 and 7490 before the industry standardized on 7400 series numbering for TTL devices.

The VOM works this: It clears the counters to zeroes, then starts a ramp generator and at the same time gates on a string of pulses to the units digit counter. The ramp generator and unknown voltage both go to a comparator. When the ramp voltage becomes equal to the unknown voltage, a logic signal is generated which gates off the pulse train to the counter. At the same time or just after, the latch signal is given to the 7075 to update the display.
Next, a clear signal is given to the counters and the next measurement starts.

Initially, I was going to monitor the DMM's "clear" line, and after it was asserted, I would substitute my pulse string, virus like, for its own, in the available window. For example, if it's 8:37 AM (or PM), I send 837 pulses and the DMM is none the wiser. I'd have to sneak them in fast enough to be finished before the DMM generated its "latch" pulse. Due to technical difficulties too tedious to describe here, I wound up having to take control of both the clear and latch lines form the PIC. Easy enough except my idea of keeping things minimalist by using an 8-pin 12F629 chip severely challenged me for my I/O needs as the project progressed.

B. The software ...

I was initially going to use a 32,768 (2^15) hertz "watch crystal" for my PIC's timebase, just because that approach seems to go with clocks. You divide it down to 1 Hz and -- Bob's your uncle -- you're there. But that speed was too slow to allow me to jam my train of pulses (maximum of 1259) into the available window. So I went to a 455 kHz crystal and to a method of calculating 1 second intervals that's lots cooler. Here we go ...

This uses a technique I found on the web described by
Roman Black, based on an idea by Bob Ammerman. It uses a
method based on the Bresenham algorithm which produces
intervals that average exactly a second, although there
may be some small jitter (which can be calculated) in each
second's time.

It will work like this. My clock speed is 455,000/4 or
113,750Hz. I put that number into a 24 bit variable. I set
timer 0 to interrupt every 256 counts. At each interrupt,
I subtract 256 from the variable. When the variable becomes
less than 256, I add 113,750 to it and increment the seconds
count.

Obviously, over time my *average* second takes 113,750 counts,
which would be perfect. But each individual second could be
off by as much as 256, so my maximum jitter is 256/113,750 or
0.23%. If I used a 1MHz clock and interrupted every 128
counts, jitter would be 0.0128%, but 0.23% is plenty good for
this application. My Nixie clock won't show individual
seconds and over 60 seconds the errors should cancel pretty well.
(What's the accuracy over longer periods, assuming a perfectly
accurate crystal? Well, the uncertainty is never larger than
256 counts at any given time. So for a full minute, the jitter
would be 0.23% / 60, for an hour, it's 0.23% / 3600, and so on.
That's why it's said to approach perfect accuracy over time.)
Black said you can do this for any crystal frequency. I'd
say that's true, but since the PIC clock is Fxtal / 4, if
that division didn't yield an integer, you'd want to trim
the crystal's frequency (+/-3 Hz maximum) to produce an integral
count.


C. Summary ...

Nick's Law says that any programming or hardware project will be two to ten times more complicated than originally envisioned. This one fell comfortably within those boundaries. The clock works great. A clock doesn't have to do much, right? But it keeps good time and doesn't lock up or show any strange behavior. At least not any more.

A few things are missing or not fully developed. First, there's no colon. I can manipulate a decimal point into that position if I want a delimiter. I've considered using a long neon tube painted black except for two dot-sized openings on each end, and possibly using two small yellow LEDs, but I decided it was time to call this project to a halt.

Another sort of clunky part is that my setting routines aren't very well human engineered, but they do work. I added small surface mount SET and ADVANCE pushbuttons on the rear of the case.

Finally, I wanted battery backup. The PIC board should pull less than 1 mA so a tiny battery should maintain the time even during long outages. I mounted a little 3-cell nicad pack in the box, diode auctioneered with the main 5 VDC supply, but I abandoned it when I had startup problems. I found that the PIC needs a clean RESET signal, which here means pulling the supply voltage all the way to zero. So to use the battery, I'd need a third button on the back of the box, labeled RESET. But I've declared this project finished.

Nixie mania? Just this month (September, 2009) I found another Nixie based DMM at a hamfest for $5. It's a Bell & Howell unit made by Heathkit for an electronics class. But it has only 2 & 1/2 digits so isn't suitable for use as a clock. I should consider myself lucky.