<blog:entry xmlns:xh="http://www.w3.org/1999/xhtml" xmlns:blog="http://www.adamretter.org.uk/blog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.adamretter.org.uk/blog http://www.adamretter.org.uk/blog/entry.xsd" status="published" id="dcf874d3-a614-4daa-bae9-c0c5b558cba4">
    <blog:article timestamp="2009-04-22T12:30:00.000+01:00" last-updated="2009-04-22T12:30:00.000+01:00" author="Adam Retter">
        <blog:title>A blast from the past</blog:title>
        <blog:sub-title>the first serious code I wrote???</blog:sub-title>
        <blog:article-content>
            <xh:p>Recently I had been unpacking some boxes of older and more obscure belongings that I never felt the need to unpack, I have moved house twice since 2004 and these boxes have only just been unsealed! Whilst looking through the contents, I found some old 3.5” floppy disks and low density ones at that – wow! One of those disks turned out to contain the code for something called “SM~ART”, which made me feel very nostalgic; although for the life of me I cant remember what the acronym stands for!</xh:p>
            <xh:img class="left" src="blog/images/pc3286.gif" alt="Amstrad PC3286"/>
            <xh:p>SM~ART was quite possibly the first serious project that I ever undertook in software. It was 1997 and I was 16 years old and in the final year of my GSCE studies at school. Since as long as I can remember I have always had an interest in electronics, which unfortunately (for my family) as a kid meant me taking things apart (sometimes they also went back together again). With the first family computer an Amstrad PC3286 I became equally as interested in computers. Anyway, I digress, I had been studying GCSE Electronics and with my final year project approaching I decided I should undertake something to get top points and really show everyone that I meant business.</xh:p>
            <blog:mini-title>Hardware</blog:mini-title>
            <xh:p>With the help of the book <xh:a href="http://www.amazon.co.uk/Interfacing-P-C-s-Compatibles-BP-Penfold/dp/0859342174/ref=sr_11_1?ie=UTF8&amp;qid=1240411783&amp;sr=11-1" title="Interfacing PCs and Compatibles by R.A. Penfold (Amazon)">“Interfacing PCs and Compatibles” by R.A. Penfold</xh:a>, I embarked on a seriously ambitious project to design a 16-Bit ISA bus card for the PC for data acquisition. The card basically just extended the bus to a socket which was then connected to the data acquisition hardware in an external housing. The ISA bus card had a hard wired address decoder built out of 74LS* TTL logic chips, and the acquisition hardware consisted of an <xh:a href="http://pdf1.alldatasheet.com/datasheet-pdf/view/66100/INTEL/8255A/datasheet.pdf" title="Intel 8255A data sheet">Intel 8225A</xh:a> general purpose I/O chip, and a couple of 8-bit analogue to digital converters; this allowed a configuration of either three 8-bit parallel ports or one 8-bit parallel port and 2 analogue ports. I will publish the schematics if I ever find them.</xh:p>
            <blog:mini-title>Software</blog:mini-title>
            <xh:a href="blog/images/smart-main.jpg" title="Click for full-size image">
                <xh:img class="left" src="blog/images/smart-main_small.jpg" alt="SM~ART Main Screen"/>
            </xh:a>
            <xh:p>So I had the hardware, but that would of been useless without some software to operate it – so I developed SM~ART. SM~ART was written in Microsoft QBasic 4.5 on our 286 PC at home. I think I probably chose QBasic at the time because it was just enough to get the job done, I had a couple years hobby QBasic experience and QBasic provided the INP and OUT statements which enabled me to read or write directly to a specific hardware address – in this case my data acquisition hardware.</xh:p>
            <xh:p>SM~ART consisted of a very simple graphical interface with a number of screens - Console (for communicating with the hardware), Change Settings (various settings for communicating with the hardware), Change Colours (change the screen colours of the SM~ART interface). All of the settings were persistable to disk and I think it was also possible for it to create log files of data received from the hardware, or for it to accept a file of commands to execute against the hardware.</xh:p>
            <blog:mini-title>Conclusions</blog:mini-title>
            <xh:p>Well I submitted both the hardware and the software which were graded pretty high. Unfortunately it was never possible to test the two working together, no one had a PC they were willing to risk me destroying with potentially faulty hardware, so that counted against my grade a little.</xh:p>
            <xh:p>I had a look through the QBasic source code for SM~ART and I have to say that I am pretty impressed. Whilst its 'basic', it actually seems pretty clean, there are some comments (could probably use more) and its logically organised; I have to say I am quite happy with my yesteryear coding skills :-)</xh:p>
            <xh:p>Source code is available here if anyone is interested - <xh:a href="blog/entries/SMART.zip" title="SM~ART Source Code">SMART.zip</xh:a>
            </xh:p>
        </blog:article-content>
    </blog:article>
    <blog:tags>
        <blog:tag>Code</blog:tag>
        <blog:tag>QBasic</blog:tag>
        <blog:tag>Hardware</blog:tag>
        <blog:tag>8255A</blog:tag>
        <blog:tag>Software</blog:tag>
        <blog:tag>PC Interface</blog:tag>
    </blog:tags>
</blog:entry>