terça-feira, 31 de janeiro de 2012

I'm Alive

So, there I was with the CPU in my hand and the first thing it came to my mind was "maybe this thing is broken! maybe that's why the boards were thrown away..."
Well, fortunately for me this CPU has what is called "freerun" mode. In a few worlds, this CPU can work with no memory and no peripherals just by forcing the pins to vcc or gnd... perfect!

Having a clock source, the control signals all tied to the proper level and all data bus grounded I powered up the board and there it was, this greed led connected to one of the upper address lines, blinking, like if it was telling me "I'm alive!".

Technically all 0's in the data bus matches the opcode 'ORI.B #0,D0' this means that the CPU is reading and Immediate Byte value '#0' and making a boolean OR with the contents of the internal register D0. After that, another equal instruction follows in the address bus, making it sweep all the 16Mb addresses making it a beautiful... counter!


Having the proof that it was (apparently) working, I decided to gather some sram from those same boards (I needed at least two of them for the 16-bit data bus). Too bad the biggest sram's on that board was only of 2Kbytes (and there were a lot of them!).
Back in that time huge sram chips didn't exist an the ones that did exist were very expensive.


2x UM6116K-2 - 2KByte SRAM from the original boards.


With everything connected, all I was missing was a way to get some code in that ram. At first I thought in burning some roms since I had a lot of uveprom's from the boards. But when I really though about it, developing code would be painful... I needed a way to develop code and test it fast...

After some time thinking about it I had this idea of using the parallel port to program the srams, and it worked like a charm! Using shift registers, latches and buffers I was able to program the full 4KBytes with the parallel port. The address was loaded into the serial registers, then I could read or write data in the data bus. I wrote a small program that could write or read the sram (in turbo pascal at that time).

Now I had a fast way to test and debug code, and there I started making little assembly programs that the only thing they did was to manipulate bytes in the sram (that I could read with the parallel port interface). I do remember that the first piece of assembly code I've tested was as simple as loading two registers with some numbers and them saving the multiplication result in some memory location that after reading with the parallel port I could check that, after spending some days (or even months) under the sun and in the rain, this guy could still do some real math!

Later I've put my hands on a USART (a M82C51A) and finally had a door to the world! I then started the development of a serial bootloader that when finished would go into 2 ROMs and allow me to remove all the parallel port to sram circuitry.


My version of the famous Willem programmer used to burn... well, everything!



Some time passed and these new things called programmable logic devices appeared.
I've build a GAL (Generic Array Logic) programmed and programmed some GAL's which replace many of the original glue logic. I guess these devices have died meanwhile (or better, evolved into CPLDs).
Meanwhile I've made a few more improvements. The most significant were the upgrade of the available RAM to 128Kb (4x 32Kb SRAMs from an old PC motherboard, used as cache memory) and the migration from uvprom to flash memory (two brand new W29C020).


My GAL programmer. Made from a single side pcb version from this source.



And that it was, my single (bread)board computer! With 512Kb flash memory and 128Kb RAM.

And when I thought everything going good I was wrong... In one minute I had million ideas and in the next minute I had zero ideas to do with the board... the year was around 2001 and for some time the only thing that was developed in that board were layers and layers of dust...



But then it came a day when...
(in next post I'll talk about two major projects I used this board for)

quarta-feira, 25 de janeiro de 2012

Origins

And this all started about twelve years ago when I've spotted these two huge pcb boards dumped on a sideroad near some other uninteresting trash. These two boards had a lot of eproms (uv erasable) easily identifiable by the stickers on them covering the UV window and identified by the letters "ROM1 ODD" "ROM1 EVEN" and so on up to ROM32 or so. There was also these big population of small chips all over the boards. (later I've realized that this boards probably belonged to some arcade machine)

And in the middle of one board there it was, this huge chip named MC68000P8.


The original CPU scavenged from the original PCB


Back in that time my knowledge in electronics was pretty limited, so I didn't have a clue of what that huge chip was. After some quick research I've found out that it was a 32-bit CPU! I remember there were some websites with a lot of information and a few schematics on how to connect this big chip. The other chips lying around where mostly buffers, latches, glue logic a Yamaha chip (for sound effects) and some other unattractive 8-bit CPU (the 6502 if I remember correctly, maybe used to deal with the sound).

So, there I was with with the 68k in my hand and very enthusiastic in getting that thing up and running!


In the next post I'll talk about from the first sign of life to the fully functional board with serial bootloader.