Friday 11 February 2022

16 - Software, not Ham radio

This started as a post about my view on software development and turned into my memoirs...

Each of us has undertaken a journey that colours our perspective. My journey in writing software began 50 years ago when I was 15 and took a class at school in Computer Science -  a very new option then (1969).

I began with the ALGOL programming language, this was one of the big three languages of the time, the others being COBOL and FORTRAN. We wrote our code on special A4 sheets of paper on a Tuesday and our teacher took them to a local technical college a few miles away on Friday and we got computer printouts the following Tuesday. If you had made a simple typing error like omitting a comma then you had to wait a week for the syntax to be corrected. you have to be careful when writing programs, they can't be approximately right.

Nonetheless, I found the creative part of programming very satisfying, my earliest program found all the primes in the first thousand numbers, I still remember the algorithm, it was mostly inefficient although my version was smart enough to only search up to the square root of a thousand plus 1.

I left school at 18 and went to the local university to study engineering, after 6 weeks there I was approached by a government department who asked me to undertake an industrial sponsorship scheme - one of their entrants had dropped out and I had mentioned to my entrance tutor I would maybe have liked a year off. The sponsorship scheme was a brilliant way to do engineering, 12 months working in a company, then the university degree with summers spent working in the company and then an obligation to work in the company for a couple of years after finishing, described as a moral obligation and not a legal one. The sweet spot was you got paid throughout all this so I never had to ask my parents for money when I was a student. I ended up with a very high tech company that made microprocessor based medical instruments. They also produced minicomputers to be used in hospital laboratories as well as bespoke software solutions for businesses and labs. Early on they brought in microcomputers from the states and became dealers for the Commdore PET and Apple machines. Early geek heaven.

I remember being handed two thick books and told to write a mastermind program on a microprocessor development board. The books were the Motorola data book and the application manual for the M6800 8 bit microprocessor. A happy 2000 pages that I devoured with intensity. The development board had 256 bytes of ram and had a simple monitor program that allowed entering hex bytes into memory (a "M" command) and to pass control to an address where you had placed your program (a "G" command). The monitor also allowed reading and writing the contents of memory to paper tape - if your terminal was a teletype. These beasts were old and very noisy printers and keyboards with attached paper tape punches and readers, 2000 moving parts and three feet wide using rolls of paper. No glass screens. 

After writing mastermind (also called bulls and cows I think) I went on to write my own monitor, memory test routines and even a disassembler  I also wrote a crude semicompiler that could process BASIC like statements and produce assembly language. Didn't quite get it finished but it did cause me to be interested in compiler writing although it would take me 10 years to get back to it (with the MIPs 32 bit microprocessor)

Mainly I wrote bits of code to talk to bits of hardware that we were building and interfacing to our microprocessor systems. These were card based, it took several cards to make up a system in the 19 inch wide racks we used, a power supply card, a processor card, an eprom card, a ram card, a serial communication card and a parallel interface card. A modular system was easy to debug and repair. single sided 43 way edge connectors and only a few chips per PCB, this worked well and allowed low cost PCBs to be made in-house, double sided but with soldered thru links.. 

Funny how you learn the laws of unintended consequences. The company had 3 or 4 young bright things of which I suppose I was one. I tended to do microprocessor hardware design which also involved some software. Others focused on repair, (Aubrey Sayers) manufacture/production (Helen Hall) or pure software (Nigel Young). After me came Ivan Bell, Alan Watts and Angela - memory fails here... but the company changed direction a bit in later years. 

When I joined the company it did bespoke microprocessor interfacing, bespoke small scale electronic production as well as being a software house and its medical instrumentation product. (a computerised interface to laboratory blood analysers). Aubrey, the young undergraduate/graduate doing repair got fed up replacing a particular chip on the boards - it always seemed to be the one to go faulty. A 74LS133 chip that looked at a lot of address lines and was used to map boards to particular address ranges (the M6800 had a 16 bit address bus - 64k of space but we only 2k eprom board and 256 byte memory RAM boards at first). The reason why the 74LS133 chips broke was interesting, an education.

The 43 connections had +12v pin adjacent to one of the address lines and when you pulled a board out and reinserted it, if you were at a slight angle the gold finger momentarily connected the +12v to the address line blowing up the '133. This happened because, even with the power switched off the +12v was still present on the smoothing capacitor that was on the 12 volt output, it decayed very slowly. It had been this way for several years before Aubrey's smart thinking tracked down the fault (more a feature I suppose). Adding a 10k resistor across the cap ensured its voltage died away quickly and the number of faults reduced dramatically - we had supplied spare boards to 30 or 40 hospitals across the UK and encouraged user repair by board swapping. Nice one Aubrey!

We also brought in (SWTPC) M6800 systems from the states and these even had floppy disks, this was the start of the home computer revolution, at least in the states and we were in the vanguard of bringing it into the UK. We also brought in software libraries such as floating point maths routines and simple BASIC interpreters, tinybasic (3.5k of code), integer BASIC(4k) and a powerful floating point basic that took up 8k of space. I recall wiring code for a system to be used on television for a quiz game - basically snakes and ladders. It was one of the summers when I worked at MSCS as an undergraduate. I had to load the BASIC interpreter into RAM and then load my code as well - both using paper tape. It took 40 minutes unless there was an i/o loading error when I had to reload the portion of paper tape and try again, I remember one day having to load three times and it took to lunchtime to get the system up. Then there was a power fail and I burst into tears and went home. It is not often an 19 year old man cries...

I learnt a lot at this company, then called MSCS Ltd. When microcomputers arrived we were quick to do smart things with them, I recall having a Commodore PET interfaced to a parallel interface board and using BASIC and machine code to drive parallel voltages to DAC chips to set the gain in a really complex data acquistion system that involved making a fast ADC out of three or four chips and having the ADC feed its data into 16k of dynamic RAM, I built the circuitry to access and refresh the RAM in hardware. This memory meant we could do time travel...

We had been commissioned to make a system that monitored faults in power stations, monitoring many voltages and storing 1/5th of a second of data in memory - in a circular buffer. A separate board detected a power station fault and after a short delay (say 1/10th of a second) stopped sampling voltages and outputted the data into a UV paper chart recorder - which took 60mSec to get up to speed. The buffer had the data both before and after the fault and you could go back in time nearly a 1/5th second to see which voltage went wrong first.

My circuit board had scores and scores of chips, my boss Ken Richey had designed most of the digital parts although I had to modify it to get the timing just right to get the dynamic RAMs to work. The full system went into a wardrobe sized cabinet and was an impressive bit of work. It spawned a company that sold them into the Americas and went on to great things (Power Automation Products and then CSD Ltd).

When the Apple microcomputer came along I was fascinated by it, this was the Apple 2 (Apple ][ and then the ][e) and not the later Apple Macs though I did get to play with the Apple Lisa a bit. The Apple ][ came with an orange book that gave complete design details and a complete industry was spawned making add on interfaces. The back of the microcomputer had 8 slots which allowed adding lots of extra boards to interface to external equipment - really handy for MSCS which was interfacing microprocessors to all sorts of industrial devices

I designed and built lots of plugin boards; serial boards, parallel boards, even bank switched memory boards. These all required software written in assembly language for the Rockwell 6502 which was very similar to the Motorola M6800 I had started with. I made many complete systems, my favourite was used in a lab in the Department of Agriculture in Belfast. It controlled three bomb calorimeters. These had relays that caused a heater to burn all the oxygen in a sealed container that contained pig shit I think. The computer had to wait for a stable initial temperature, trigger the burn and wait for a final stable temperature, the more "fuel" (calories) the higher that final temperature. A human had weighed the sample and had to enter a serial number into the computer.

One of the unique things about the Apple ][ visual display was that not only was it completely memory mapped, there were routines were you specified the coordinates of a box within the display and you could scroll it by calling a routine in the Apple firmware. I wrote a system that split the screen into 4 or 5 and included three vertical columns that showed data for the three calorimeters. These scrolled independently and the various numbers changed and flashed, displayed inverse video etc as the state of each machine changed. Remember this all predates windows!

I recall avidly reading the Byte magazine and Dr Dobb's journal every month and soaking up what was going on in microcomputers. I taught myself USCD Pascal which really replaced all the Apple innards with a new operating system, very interesting. As MSCS was a selling lots of different stuff, the development engineers often got to "test" (play with) things before we shipped them. Hence I also played with the CP/M operating system and some of the other languages it could support. Colleagues used Forth and Fortran, my boss even played with LISP. Often we could use the new technology to deliver a solution to a customer - we got to stay on the bleeding edge of technology and the customer got a product that performed well or could do extra things, 

I also had an introduction to minicomputer programming as we had some bigger systems, bit like the DEC PDP range of machines. I also recall the first 16 bit microcomputer arriving at the factory for evaluation, this was the predecessor to the IBM PC. In fact it ran CPM/86, the first MSDOS was yet to arrive. I remember laughing when the machine beeped and said "ERROR: Keyboard missing, hit [F1] key to continue"

An IBM Dealer manager arrived to assess whether we could sell IBMs. An interesting guy, I had little experience of very (very) big companies and the strict all encompassing culture of IBM was amazing, though not my cup of tea. He said that IBM often setup two factories to make something, at opposite sides of the world sometimes. The job of one factory manager was to make it cheaper than the other one. They also did not add up the manufacturing cost of a product and just add a margin (multiply by a ratio is actually more accurate) to set the selling price. No, IBM had decided they could afford a chunk of money to make PCs (actually only one day of IBM's annual turnover got invested at the start). So to set the price they asked the marketing department, "what is the highest we can charge for these computers so demand is suppressed and we only manage to sell x million of them" This is why the IBM PC was twice the price of anybody else and a large clone market appeared. 

It was a salutary less in business methods that this was a brilliant strategy, "Make it for as cheap as you can and sell it for as much as you can" There are a lot of smart people at IBM.

However the time came for me to move on. Developing products all the time is stressful and can have very long hours, particularly in very small companies. I had been a part time tutor for the Open university and an opportunity came up to apply for a lecturing post in the University of Ulster - actually called the Ulster Polytechnic at the time but the name change was planned for the following year. I successfully entered academia on a "Fresh Blood" appointment and stayed there until I retired.

I never fully embraced the academic side of things, the traditional career route of churning out papers . These sometimes came so fast, one had to doubt their value, but it is part of the game. Besides by doing lots of consultancy I got to play with interesting things and enhanced my salary too - academic research grants got you money too, but you could only spend it on certain things, going to conferences, hiring PHd students and sometimes getting equipment. I also enjoyed the teaching and specialised in embedded microprocessors, both digital hardware and software. In fact as new technology came along I was able to amend teaching curriculums to suit my own interests and got to learn and lecture on Linux as an embedded operating system, 32 bit microprocessors, Internet Socket programming and Real time operating systems (FreeRTOS). To really know something, you should teach it. Geek heaven again!

In the early days you were left alone to become an expert in something and the freedom to study what you wanted was fantastic. I tended to work 60 hour weeks until the Summer and then disappeared with my computer and with a few interesting textbooks to the caravan in Donegal and latterly away abroad in our cruising yacht, France and the Baltic. I set many interesting final year projects for students to undertake; most of colleagues found this a hindrance to their own work but I loved it as an outlet for some of my more outlandish ideas. I was involved with dozens of industrial consultancy schemes; Teaching company projects, Fusion schemes with companies over the border where I mentored young bright things in industry in specific projects for the companies they worked in, usually a new product or product line/area and occasionally new processes. This certainly kept my brain alive!. There were also one week Innovation Voucher schemes where I worked with entrepreneurs on their own, sometimes, outlandish ideas. There were a couple of longer term projects too. All good fun, really good fun.

My interests in Ham radio and Sailing are listed elsewhere, but this is where I came from... so far ok...

No comments:

Post a Comment