Category Archives: Electronics

Satisfying my curiousity about the original Cockroft-Walton voltage multiplier

I was reminded of the Cockroft-Walton voltage multiplier recently, because I was thinking about building a small one for fun, and upon seeing that their development of this started in 1932, I was curious about some of the details of how they built it. In particular:

  • Were there any sort of usable high voltage solid-state rectifiers then?
  • If not, what kind of tube rectifiers were they using?
  • If hot cathodes as I would expect, how did they provide the heater supply isolated at voltages in excess of 100 kV
  • What was the output of their original multiplier?

Turns out their 1932 articles are easy to find and fairly pleasant reading:

The first article is mostly about the high voltage generator, and the second is mostly about what they did with it. In essence they produced about +700 KV and beam currents (positive hydrogen ions) on the order of 10 microamps. Most of the current was lost to corona discharge, they state that it was over half a milliampere. The interesting thing is that they did use a custom-built version of the standard hot cathode vacuum diode. The filaments were each heated by “6-volt accumulators”, which in my understanding probably means a lead acid battery. There are a lot more details about the vacuum system, naturally it takes quite a while to completely pump down the apparatus to operational levels.

Anyway, if you are interested in high voltage gadgetry or experimental physics, you should read the linked papers, they’re quite enjoyable. (Edit: Actually, there are 6 papers in that series, see this search result.)

First FPGA project ideas

I decided recently that I want to really learn computer hardware design. Not just the theoretical “I know how the machine works” understanding, but actually having done it. So, the obvious thing was to get an FPGA and design stuff using it. fpga4fun was some of the inspiration for this. I ended up ordering one of their Cyclone II boards after deciding that I was going to play with the Altera stuff (Xilinx has comparable parts. For more sources of FPGA dev boards, see Sparkfun(only one), Digilent, and XESS.) The Altera software (Quartus II) seemed a little bit less obtuse. Otherwise I can’t say I found myself strongly in favor of one or the other. As for Verilog versus VHDL, I’m learning Verilog because it’s more readable, and more commercially popular (at least in the USA). Once I understand what I’m doing, I’m sure I can learn VHDL later.

Over the weekend, I’d been playing with the free version of Altera’s Quartus II software, writing a bit of Verilog and seeing what it compiles into. The Cyclone II EP2C5 is a reasonably capable part — 4608 “Logic Elements” (each is a 4-input lookup table — 4 bits in, 1 bit out, any truth table), carry chain logic, a register on the output, various stuff to connect it locally, across the chip, and to the clock distribution network), 119808 bits of ram in “block ram” scattered about the chip, 13 18×18 multipliers, and 2 PLLs for clock generation.

So, I got to thinking that a suitably hard project is a modern reimplementation of the 1980s home computer / game console. This would consist of a number of subprojects:

  • a CPU — probably early MIPS, R2000/R3000 or something. a subset of MIPS32. Not too hard to understand, I still have the Patterson and Hennessy textbook that gave a pretty nice introduction to it. Also, existing GCC support.
  • SDRAM controller — having looked at a datasheet, supporting a single 4Mx16 SDRAM chip shouldn’t be that hard.
  • Display controller. Low-color-depth VGA wouldn’t be too hard, but then I’d constantly have to hook a VGA monitor up, etc. A more interesting choice seems to be to support one these Sharp LCDs
  • SPI interface to an SD card. Have the first stage bootloader in the FPGA block ram load code from here into the SDRAM.
  • USB low-speed host controller, really only supporting keyboard/mouse/joystick. Another challenging piece, but not that bad
  • Serial port for debugging software.
  • Sound controller. Maybe an all-digital implementation of the SID in a C-64, or maybe the much simpler sound chip found in the TI 99/4a, IBM PC Jr., Sega Master System, etc.

So far, I’ve written Verilog for parts of a 3 voice + 1 noise sound chip (the simple one above), and I’ve implemented a register file and an ALU. Most importantly, I figured out how to use the right idioms to make the register file out of block ram, instead of consuming a quarter of all the logic elements on the chip.

But, wow, that’s a big first project. While I can design and test it piece by piece, I think it might be more fun to start out with something simple: A 16 bit stack-based CPU, interfaced to the on-board block ram (only about 13K bytes), with a serial console. I’ll have to cobble together some sort of assembler, but that’s not that hard. Especially when the instruction set is simple. I’ve been reading Stack Computers for inspiration.

Another possibility, instead of a stack CPU is some kind of stripped-down mips-like 16 bit architecture. You get into some compromises with 16 bit instructions if you want a reasonable number of instructions and the usual 3-operand instruction format, though.

(For more links, see my del.icio.us.)

Touch sensor tweaking

The one thing that wasn’t quite behaving right about the LED lamp was the touch sensor. I was having trouble both with it being far too sensitive (and sensitive to interference from other devices nearby — I’d plug in my laptop to an adjacent outlet and it would sense a “touch”), but also it was often not self-calibrating properly.

So, I reread Quantum Research Application Note AN-KD02, “Secrets of a Successful QTouch Design”, and I finally tried properly doing the procedure in section 3 for probing the sensor field. And I discovered one thing: the Rsns value I’d previously guessed at was far too small. I was using 1K, while I got the appropriate sort of risetime with about 18-25k. I decided that Cs was probably also far too high, so I tried reducing it from .044 uF to .022 uF.

It’s a little bit less sensitive now — you have to touch the area on the outside of the glass with at least a couple fingertips, but it’s far more reliable and less prone to interference.

Also, it seems to be recalibrating its threshold more quickly now.

I may try adjusting the value of Cs a little more (need to buy more values of 1206 surface-mount capacitors), but I think I’m almost “done” now.

On another note, I think there’s some FPGA design in my future. It’s got quite a learning curve, but it looks like fun.

More LED lamp software development

I’ve completed the software.

I abandoned the SOIC test clip in favor of wires soldered directly to the board. The SOIC test clip loses contact with the IC if you just look at it funny. It’s very irritating. In the future, all boards will have an in-system programming (ISP) connector.

I just need to finish the mechanical part. I’m waiting on an order for some more nylon screws because I screwed up and ordered the wrong length.