<?xml version="1.0"?>
<!--Copyright Brian Starkey 2011-->
<page title="Launch Codes" dir="projects/launch_codes" filename="codes" type="windowpage" root="/xml_95" xmlns:xi="http://www.w3.org/2001/XInclude">

<window title="Launch Codes">
	<menu>		
		<menu-item name="File">
			<!--<pdf-subitem name="Get PDF"/>-->
			<home-subitem name="Home" href="{/page/@root}"/>
			<menu-subitem name="XML" href="codes.xml"/>
		</menu-item>
		<!--include common menu items (dynamically generated)-->
		<xi:include href="../../external_menu.xml"/>
	</menu>
	<substance>
	<locations name="{/page/@title}">
		<folder name="Documentation">
			<!--<leaf class="pdfleaf" name="proj.pdf" href="proj.pdf" />-->
			<!-- img="/images/pdf_icon.gif" -->
			<leaf class="sectionleaf" name="Introduction" href="#Introduction"/>
			<leaf class="sectionleaf" name="Software" href="#Software"/>
			<leaf class="sectionleaf" name="Hardware" href="#Hardware"/>
			<leaf class="videoleaf" name="Video" href="#Video"/>
		</folder>
		<folder name="Code">
			<leaf class="zipleaf" name="zip" href="code/launch_codes.zip"/>
			<folder name="PC (curses)">
				<leaf class='codeleaf' name="launch_codes.c" href="code/PC/launch_codes.c"/>
			</folder>
			<folder name="AVR">
				<leaf class='codeleaf' name="makefile" href="code/AVR/makefile"/>
				<leaf class='codeleaf' name="launch_codes.c" href="code/AVR/launch_codes.c"/>
			</folder>
		</folder>
	</locations>
	<window-contents>
		<row>
			<image src="images/code.png"/>
			<section-title name="Introduction"/>
			<section-content>
			Probably one of my most useless creations, this consists of a 5-digit 7-segment display which shows random numbers.
			That's it. I had the display and had nothing to put on it, and quite liked the idea of showing codes like you see in the nuclear bunkers in films.
			</section-content>
		</row>
        <row>
            <section-title name="Software"/>
            <image src="images/curses.png"/>
            <section-content>
            Before I embarked on the hardware side, I wrote a curses program to try and get the right effect in code first. There's basically an array of 5 <i>char</i>s, and 5 random numbers,
            one for each <i>char</i>. The <i>chars</i> are incremented, and then all 5 are displayed on screen. This continues, with each digit ceasing to be incremented once it has done its
            respective random number of cycles.<br/>
            Clear as mud?<br/>
            Basically each number is incremented a random number of times, 'locking' into place and waiting for the others to finish. Once this code worked on the PC, I simply ported it to the
            AVR - instead of displaying via ncurses, I display on the 7-segments.<br/>
            <style style="color: red">Note:</style> If you try to compile the <link href="code/PC/launch_codes.c">PC code</link> remember to use the -lcurses flag to link with libcurses.
            </section-content>
        </row>
        <row>
            <section-title name="Hardware"/>
            <image src="images/P1000481.JPG">Amplicon Label</image>
            <image src="images/P1000483.JPG">Display Board</image>
            <section-content>
            The display itself is an <i>Amplicon Liveline - Digital Panel Instrument</i> from around 1990 judging by the date codes on the logic ICs. I have no idea what its orignial function was
            - some kind of readout in some expensive machinery I should imagine. The original circuit board had an edge-connector sticking out the back, and included a mains transformer, some 4xxx
            series logic and some other bits and pieces which I forget. The display board itself was connected via a row of 33, 0.1" pins soldered to the main board, and is populated with 5 red
            7-segment displays and 4 MC14511BCP BCD to 7-segment drivers. The 5th driver was on the main board, along with 3 4518 dual BCD counters, which I salvaged for re-use in my circuit.<br/>
            Mapping the connections to the display board was a long and tedious job, and I have since lost the pinout, but hopefully I will find it again so I can post it here. I replaced the main
            board with a piece of protoboard the same size, and built an Attiny2313 based circuit to make the magic happen. I also included a piezo beeper from an old computer, and added some code to
            make it beep every time a number 'locked' - nothing too obnoxious and it makes for a nice effect.<br/>
            I never figured it out exactly (didn't seem worth the effort), but the original circuit was AC driven somehow, and there were diodes in the corners of the <link href="images/P1000483.JPG">display board</link>.
            I removed one, and replaced the other with a resistor to get DC to the logic and displays.
            </section-content>
        </row>
		<row>
			<section-title name="Video"/>
            <video name="Video" src="http://www.youtube.com/embed/cFUnZIfpQuI"/>
            <section-content>
            The finished article! Although the camera mic didn't pick up the subtle beeps, you can get the idea.
            </section-content>
                    
        </row>
	</window-contents>
	</substance>
</window>

</page>


