- The biggest mistake with the controller PCB layout was that the mains AC current for the heater runs parallel to the thermocouple trace. This seems to induce a small current in the thermocouple trace, causing a fluctuating reading. I have worked around the problem in software by averaging the temperature received. This seems to mitigate the problem, but it is irritating that it exists.
- A 4 digit seven segment module, instead of two two digit modules would have removed the need for most, but not all, of the annoying jumper wires.
- I’m suprised that the 7805 regulator gets warm. This may mean I have a current leak (low resistance to ground) that needs to be solved, since the circuit should not need more then a few 10s of mA.
- It’s a shame it needs to be attached in two places to mains to work: one plug for the heater/rollers and one for the control board. Not a big problem, just unity.
- I still very much love working with the AVRs. It’s different to working on the old 8 bit MPUs but very enjoyable.
Setting up the DUART counter/timer is done in the serialinit and requires writing to some extra registers:
I had fun making this little adaptor board. It was the first PCB made with the new laminator controller board, and while its not perfect it’s good enough and I was very pleased not to have to break any unwanted joins between the SDIP pins. This was also the first board I soldered up with my new temperature controlled soldering iron, and it was a pleasure to do in comparison to my old iron.
And here is the breadboard:
Because I was just testing the VDC, I only bothered wiring in one bank of 64KBytes of DRAM for the video memory. So only two 4 bit by 64K DRAM ICs were required. At the bottom left of the breadboard is a breakout board I made up for the SCART lead. Only five connections are required: Red, Green, Blue, Composite sync and “blanking signal”. The last one, when high (more then about 3V) puts the television in RGB mode instead of composite video mode.
Incidentaly, I found this image on a blog post comparing different 8 bit machines from a typography point of view. Very nostalgic and interesting reading!
This then needed to be turned into assembly source code, ie. data that could be included in the monitor. This turned out to be fairly involved, but eventually, after writing a few perl scripts, I had source code for my font.
The next stage was to write some routines to manipulate registers in the V9958, and then to load data into the video memory. It’s not worth going into too much detail here (if you are interested, read my code). Essentially to enable text mode the following steps need to be performed:
- Initialise the core registers to set the video mode, type of DRAM installed, video memory locations for the fonts and what character should appear in each character square
- Setup a simple 2 colour palette
- Load the font data into a known location (the datasheet describes font characters as “patterns”)
- Load the video memory with the message to be displayed
After some experimenting with different values in a few of the key registers I was able to make my test message appear. Here is the test message showed in the 40 column text mode:
This was a major milestone for my little computer. At this point I really felt like I was building a real, usable computer.
While the picture quality was ok (80 column text was also tested and looks just legible) it wasn’t great.
I have managed to modify the serial routines to output text on the TV by “hooking” the serial character output routine such that, as well as outputting the character to the serial port, it also goes to the TV screen. By implementing some cursor management routines, to handle carriage return, line feeds, and backspace I can now display the monitor program on the TV. Input is still via the serial port, however.
To celebrate this step for my computer I made a short video:
The last thing I’ve been working on is tidying up the VDC, 6522 and 65SPI and putting them on a brand new IO PCB. This IO board will sit on top of the main computer board as a rather large daughter board. The full list of parts is:
- VDC with DRAM
- To connect the VDC to a television, a DIN connector will be used
- 65SPI
- DS1384 Real Time Clock with Temperature sensor
- SPI header
- 6522 VIA
- 2 x 8bit parallel header
- Keyboard connector (see below)
- AY 8912 Programmable Sound Generator
- 9 pin Joystick port
So, quite a lot of cool ICs. Most of this has been breadboarded in various forms over the last year or so, so in theory there is nothing really new here. Only the DS1384 (PDF) was not used before. While I could have stuck with the trusty DS1305 RTC, I really wanted a temperature sensor in my computer. I bought two ‘1384s from good old eBay – one for the IO board PCB and one for testing with breadboard. One small complication is that this is a SOIC (50mil pin pitch) SMT part. So I also bought some SOIC to DIP adaptor boards too. The ‘1384 was trivial to talk to once attached to the adaptor board.
The joystick port is worth a brief mention. The AY 8912 sound syth also has an 8 bit IO port. It was common for this to be attached to joysticks, the ZX Spectrum 128 +2 had it’s joystick ports wired to the bigger AY 8913 for instance.
Here is the complete schematic:
This is mostly just bringing together circuits used previously. The header (top left) is the bridge between this circuit and the main board. This schematic also has the DIN 6 connector for the video connection to the television. I chose to “borrow” the connector type and pinout of the video port on the BBC Micro. This allowed me to use a ready-made lead for hooking up a BBC Micro to a television via SCART instead of me having to make up my own lead, which would be perfectly possible but a bit tedious.
The next step was to make up the PCB. This was an interesting challenge, primarily because of the board having to sit ontop of the existing main board. There are a number of clearance issues which effectively limit the size of the board:
- The vertical fuse holder at the top left of the main board
- The IDE connector at the top of the board
- The serial headers at the right top corner
These obstructions mean the board is a bit irregular. In the end I settled on the following layout:
This layout took several false starts to iterate to. I’m still not liking the gEDA PCB program, but it did the job here, even it did take several man weeks to come up with. I was especially pleased with the DRAM layout – barely a square mil is wasted. I was less pleased with the 65SPI PLCC44 layout – too many vias were needed.
The board was also a lot of work because I had to make up quite a few footprints myself. The battery connector, DIN connector, joystick connector and the big Shrink DIP64 footprint all had to be made up as they did not come with the gEDA PCB tool.
After settling on the layout, I decided to use the services of Botech once more. They did very well once again, and in a few days I had five boards in my hands:
Soldering up the board was a time consuming but easy job – even the SOIC RTC was reasonably easy – helped by a flux pen and fluxed solder wick I purchased for the job. As usual I tested as I went.
Mated to the main computer board, the two boards look great I think:
Despite my testing by making parts of the IO circuit up on breadboard there are a number of problems. However the following parts work exactly as I’d hoped:
- VDC (but see below)
- 6522 (I actually have the CMOS 65C22 socketed)
- 65SPI with RTC
The problem with the VDC was irritating, but relatively minor. When making up the DIN connector footprint, I managed to set the pinning backwards. So initially there was no picture until I cut tracks and added jumper wires, completely ruining the nice “look” of the board. After this PCB butchery, I noticed that the picture quality was quite a bit better then when the circuit was running on breadboard. In fact it was almost perfect.
Another problem I had wasn’t actually with the IO board but was with the main board. In using all those additional ICs, some of which are high current NMOS I started to run into major problems with voltage drops on all the IC power pins. The voltage drop was so large that the computer refused to start. Eventually, with the help of the nice folks at the 6502 forums, I managed to nail it down to the fuse on the main board. After measuring the voltage across the fuse I noticed the drop increasing as the current draw ramps up as more ICs are added to the circuit. As a simple “work around” I have temporarily shorted out the fuse on the back side of the board. The proper solution is to find a suitable fuse which has the same rating but a much lower resistance. I hope such a thing is available, but it is possible it isn’t since a fuse is, after all, simply a thin wire.
The final problem is one that I haven’t solved yet. I cannot get any sound from the AY 8912. The IC is “half working” though because I can read the joystick port sucessfully. I think the problem is down to the use of 74HC glue logic combined with the signals generated from the CPLD. This is the one part of the IO circuit which I did not breadboard up, so it makes sense that it would be this part which is causing me problems now. The last time I used this IC the computer’s glue logic was all discrete 74HC parts.
Once the issue with sound has been solved, I’ll modify the PCB layout and get another batch made up.
Despite the problems with the IO board, I’m very pleased with my progress over the last couple of months. My little 8 bit computer is really starting to come togeher now. It has all the fascilities any 8 bit micro ever had:
- 512KByte RAM
- IDE (something unheard of in a 1980s 8 bit micro)
- Serial ports
- Parallel ports
- Real Time Clock
- “High end” video graphics
- Joystick interface
- Sound (when it works)
One thing missing from my computer, important now it has a video interface, is a keyboard. I have some ideas for this which I will document in detail in my next post. In any case, the IO board accommodates a keyboard through the use of a header attached to the VIA.
The other big thing missing is software. After getting sound working I will concentrate on the system software needed to properly control the video interface, joystick, sound etc. After that is done I will have a computer able to run a game I will write, something I hoped (well, dreamed really) I would be able to do at the start of this little journey…
Hi. Cool project. How are you generating /VDPREAD and /VDPWRITE? Are they just generated from R/W and Q?
Hi, Thanks. It is just a IO decode combined with the /READ and /WRITE, which are themselves generated from the CPUs R/W combined with E.
elsif (A = "0101" and nREAD = '0' and nWRITE = '1') then SELECTS.nVDCREAD <= '0';
elsif (A = "0101" and nREAD = '1' and nWRITE = '0') then SELECTS.nVDCWRITE <= '0';