Programmer's Toolbox
Embedded development, then and now
Jack Crenshaw
9/22/2009 7:04 PM EDT
Old-timers who've been there should get a kick out of the look backwards, and you new-timers can thank your lucky stars you don't still have to do things that way.
Simulating gyros
My first exposure to real-time systems actually predated the advent of microprocessors. NASA and their contractors were developing the hardware and control algorithms for spacecraft attitude control using control moment gyros (CMGs). We were developing a real-time, hardware-in-the-loop computer simulation that could test and simulate the behavior of the CMGs during typical simulated flights. I was developing the digital software; we had other computer programmers who spoke patch-cords, programming the analog side.
The problem with testing a CMG is that you need to see what it's doing in real time. That's even harder to do when the CMG is a virtual one. A CMG generates torque through the changes in angular momentum of a spinning wheel. As the torque is generated, the gyro precessors, and its angular momentum vector (the H-vector) changes. What we most wanted to see was the way the H-vectors changed with time.
The NASA guys had worked out a scheme to visualize the state of the system that was, at the same time, extremely crude and extremely clever. They hooked three output lines from the analog computer to an ordinary x-y oscilloscope. The computer generated signals to display the three H-vectors on the scope, as a 3D image. In 1972, this must surely have been one of the earliest 3D graphics displays ever built.
The system worked very nicely, but it did prompt me to formulate a rule of thumb I've never forgotten: if the extent of your development and testing system involves three or four PhDs sitting around on a concrete floor studying an oscilloscope, you have probably not yet optimized your test facility.
Intel comes to town
In 1974, microprocessors had arrived, and the Intel 8080 was the new kid on the block. I wanted in on the action in the worst way. I joined an existing but tiny company that already had contracts in hand. At the time, our entire development system consisted of an Intel single-board computer (SBC) based on the granddaddy of all microprocessors, the 4004. It boasted a PROM burner, and a line editor and one-line assembler in ROM. Access was via a Teletype ASR33 printing terminal. The only bulk storage was paper tape, accessed via the ASR33's 110-Baud reader/punch. Storage capacity depended on the length of your paper tape. Our configuration management system consisted of a bunch of tapes, tossed into a box.
By the time I arrived on the scene, the ROMs had been updated to support a 4040 assembler.
We had one in-circuit testing tool, which you had to see to believe. We called it the Blue Box. It was not exactly an in-circuit emulator (ICE), but it did give us a view, however darkly, into the computer and its CPU chip. There was no debugger proper, and you couldn't set breakpoints to stop the CPU. What you could do was to set a watchpoint, watching the data whistling through the data bus at the breathtaking rate of 93 kHz. All the addresses were set, and data displayed, in binary using toggle switches and LEDs. Hex was for sissies.
Here's how it worked. Using the toggle switches, you set a memory address into the Blue Box, and launched the computer program. The first time the selected memory location was accessed, the Blue Box grabbed the data on the data bus. After that, the CPU continued on its way, but you had that single byte of data to peruse at your leisure. Think of it as a memory buffer with a one-byte depth.
The main problem with this scheme was that the box could only see data that went out onto the data bus. If you needed to watch the contents of a CPU register, forget it. That data never got put onto the data bus, so you couldn't see it.
Fortunately, I didn't have to deal with this gadget for long. The SBC got updated to support the 4040, which was our target CPU. Extra hardware included an umbilical that clipped onto the CPU. I wouldn't exactly call this an ICE, because you couldn't actually emulate the 4040, only observe and control one. The assembler was still a one-line assembler (no symbolic addresses). And there were no upload/download facilities at all. Instead, we used the original SneakerNet, based on EPROM chips instead of floppies. You burned the assembled program into PROM chips, then plugged those chips into the target machine. Once the PROMs and the CPU umbilical were in place, you could do all the things we usually associate with hex debuggers, including setting breakpoints, single-stepping, and displaying or modifying any data in memory or registers. It may have been a small step for Intel, but it was a giant leap for us.
For PROMs, we used the UV-erasable 1702 EPROMs, each capable of holding an astonishing 256 bytes of data. The 1702 was a big step forward from earlier burn-once-erase-never fusible-link PROMS.
The 1702s had a little quartz window. You could erase the chip by shining UV light through the window.
That's if you had an EPROM eraser. Which we didn't. But we got the same effect the natural way. We'd simply set the EPROMs out on the hood of a car, in the bright Alabama sun. Timing was a matter of cooking until done, which took maybe 30 minutes. Success depended on the weather. No sun, no erasing.
We had a second project that involved an 8080. This one was actually my "baby." It also was for an embedded application, but I didn't have much interaction with the hardware, since it was our customer's hardware, 180 miles away in Atlanta. My job was to develop the software, which included a two-state Kalman filter, the floating-point library to execute it, and the math library to compute it.
"Downloading" was still a matter of PROM-based SneakerNet, only this time it was more like PickupTruckerNet. Or FedExNet.
To support this effort, we bought an Intel Intellec 8 computer. It had no hard drive at all--bulk storage was still via paper tape. But it had lots of RAM and ROM, and supported true symbolic assemblers for both the 8080 and its 4040 brother. It also had a decent line editor, not that far removed from the ed/edlin editors of RSTS, Unix, Multics, CP/M, and Unix. Not exactly emacs, but serviceable. The hex debugger was good for debugging 8080 code. For the 4040, we still needed to SneakerNet the PROMs to the 4004 SBC.
My 8080 code was a good bit bigger than the 4040 code, so the big bottleneck was reading and punching all those paper tapes at about 8 bytes per second. We couldn't do much about the punch side--you can only make holes in paper so fast. But we could improve the reading side. We found an ultra-cheap optical tape reader (for the record, the ASR33's reader used little mechanical fingers to read the holes). To me, the new reader was a marvel of Yankee ingenuity. It was asynchronous.
You see, the paper-tape format didn't depend on tape transport speed. The data format was self-clocking, thanks to a row of little synch holes. Theoretically, you could read the tape as fast as you could get it through the reader, limited only by the I/O speeds of the Intellec parallel port.
So to read our paper tapes, we simply pulled them through the reader, much like a sailor hauling in his anchor rope. There was no takeup reel; the tape simply spilled out onto the floor, as it always had.
I went out and bought a used film editor, which had a crank-turned feed. We cobbled up a wider reel to hold the paper tape. From then on, reading a file into memory became, literally, a turn-the-crank process.





FrankCF
9/23/2009 1:21 PM EDT
My first introduction to bulk storage was drum memory. We couldn't find any commercial ones that fit our needs so we made our own. I sprayed on the magnetic coating with an air brush. After that I hit the big time with magnetic core memory. All those little donuts on a board that was at least 18" square. In the mid 70's the company I was working for found out the hard way that the sun erased the EPROMs. The sun getting in through the air vents was erasing the program. The field staff were given packs of labels to run around covering the EPROM windows.
Thanks for the memories,
Frank
Sign in to Reply
Ray Keefe
9/24/2009 12:43 AM EDT
Hi Jack,
thankyou for a fascinating and engaging account of some of your history with embedded development. I thoroughly enjoyed every byte of it.
I started as the hardware developer with analogue design as my specialty and did the reverse of your transition. Getting software people to write test code for new microcontroller based PCBs was basically impossible. It never happened. It wasn;t on their task list.
So I had to get out the assembler toolkit and write my own test code to make sure everything on the PCB was as I intended it to be. That was actually very helpful because now I mostly write code although designing PCBs is still part of what I do.
At that time, I was working for a company that had hardware engineers, mechanical engineers, physicists and software developers. As a hardware engineer I was expressly prohibited from writing software. So we just called it PCB testing. Sounded very hardware.
Software people could not do hardware. They had to have a hardware engineer present when the programmed and inserted EEPROMS and tested their code.
There was one emulator. It was a big blue box from Intel but for the 80188.
The next place I worked, needed a C Programmer so I learnt that in between gettign the job and starting which was about 5 weeks later. Of course I only learnt the basics but it got me started.
So from my perspective, embedded means the hardware and software are closely related and that knowing both is a huge advantage.
Thanks again for such a great recollection,
Ray Keefe
http://www.successful.com.au
Sign in to Reply
PWong
11/28/2009 9:26 PM EST
Hi Jack,
It's a joy to read, even without the mention of slide rules, mechanical adders or five-digit log tables. EPROM uv eraser brings back my memories.
Thanks,
Patrick
Sign in to Reply
prabhakar_deosthali
10/14/2010 1:58 AM EDT
I thoroughly enjoyed this article as it represents an era where the Embedded software developers could really write the code bit by bit and know each and every bit in the EPROM or EEPROM they programmed. They could even patch the code by just modifying a few bits in the EPROM programmer memory and reprogramming the EPROM. Today with advanced tool sets and higher language support available the Software engineer has moved away from those bits and nibbles. In 1974 when India did not have a free access to the latest technology I remember to have worked on a 12 bit computer which had piano switches along with LEDS on its front panel. The Program had to be first coded in 12 bit binary machine language and had to be fed into the computer memory using thse piano switches. Once in the memory you had the luxury of getting it punched onto a paper tape. The debugging was done using a single stepping switch and watching the LEDS for the correct binary output.
Sign in to Reply
wswbln
4/4/2011 12:26 PM EDT
What a nice flash of the past. While I missed the 4004 and 8080 part of the history I jumped in on the Z80 and Z8000.
I still remember the usual first "hello world" hand programmed in new Z80 system's EPROMs:
3E 00 D3 XX 3C 18 FB (where XX is a port accessible somewhere on the board).
Blinking LEDs was later :-)
Sign in to Reply
wswbln
4/4/2011 12:31 PM EDT
BTW Jack:
Since you mentioned in the last paragraph that you still have to get you an ARM system: Go for a Panda board. It's amazing what TI packed in that small chipset!
Sign in to Reply
hm
4/4/2011 12:54 PM EDT
Thanks for very nice article. I remember my loved magazine Elektor. It always helped me lot in this transition. I was most happy when we got our first 16KB/32B EPROM emulator hooked to PC. It reduced our developement time considerably and I have preserved it for memory.
Sign in to Reply