|8-input video switch Mark II|
Module 2: The switching and timing circuitThis second part of the video switcher allows control of the three video selection data lines to be swapped from the external source (parallel port, Velleman USB board, etc) to internal control. This internal control needs to provide the following functions:
I initially designed a circuit using 4000-series CMOS ICs and a 555 timer. While I was struggling to design the PCB layout, it ocurred to me that a PIC® Microcontroller might be ideally suited. It was nearly 11 years since I'd last looked at these chips and, to be honest, I'd been put off by the comparative difficulty in programming the things. Between the programming hardware, the programming software and the final project board, there always seemed to be a chicken and egg situation with a few too many simultaneous learning curves - at least for me!
Although they've been around for something like 10 years, I've only recently become aware of a "spin-off" technology called PICAXE® from Revolution Education Ltd. These microchips start off as "ordinary" PIC® Microcontrollers but with the programming and code-execution software already programmed in as a sort of "bootstrap loader" or "BIOS". They can be programmed in situ on the finished project's board by the simple provision of a 3.5mm stereo socket and a couple of resistors. This means they can be programmed and re-programmed with different software without having to remove them from the project. Once the chip's safely in its socket with no bent pins, it can stay there!
The company provides free programming/editing software and free support. This was the perfect opportunity to give them a try!
(For anyone interested in the original CMOS design, you'll find a very rough UNTRIED diagram, here).
The PICAXE Circuit
Operation of the circuit is controlled by the software we download into the PICAXE chip through the programming socket (shown at top left in the diagram above). Once programmed, the software remains in the chip even if the supply is removed and later restored.
The three data lines, D0, D1 and D2, on the left of the diagram are the three external lines from the computer's parallel port or the Velleman USB board. They are connected to three of the chip's pins which the chip automatically defaults to be inputs at power-up (B.0, B.1 and B.2). If switch SW2 is open (External), the three data lines are simply passed through the chip and appear on its output pins at C.0, C.1 and C.2. (Our software will configure these pins as outputs). From there, they simply connect via a couple of headers to the data input of the Video switching board. To all intents and purposes, this second circuit is effectively 'transparent.'
When SW2 is closed (Internal), the data lines at B.0, B.1 and B.2 are ignored and control of the output pins (C.0, C.1 and C.2) passes to the software inside the PICAXE itself: