Friday, 14 March 2014

DIY PCBs and more work on the core computer

So, it's been a bit of a mixed bag this month with the 6809 computer. First of all, I have decided to do the SBC "properly" and use a single CPLD instead of two. With that goal in mind, I've ordered a few parts:
  • XC9572 in PLCC84 (3 of)
  • PLCC84 sockets (4 of)
Initially I wanted to buy some XC95108s. These have 108 registers, so can be used to create slightly more complex designs. But UTSource (my favorite Chinese eBay seller), although they were listed as being in stock didn't actually have any. So I had to go for the more limited '72 parts.

But then I had some good luck: a fellow user of the 6502.org forums, lordbubsy, had a spare XC95108 PLCC84 and a nice breakout PCB with socket available. In turn I've sent him a spare Xilinx USB JTAG programmer. So very shortly I should have more then enough CPLDs to last me including 3 x 44pin XC9572, 3 x 84 pin XC9572 and a 84 pin XC95108, along with plenty of PLCC sockets. Phew!

Using a single CPLD will save me a whole bunch of pins, and should allow me to create a fairly sophisticated custom IC design. I've started to code up what I described in my previous post, with the addition of a sound output line. This will be the most complicated part of the design. The purpose (other then for fun and learning) of the sound output is so that I can include a small sounder on the SBC PCB itself. I can then have the computer generate tones on booting, etc.

There are many approaches to tone generation in a simple micro like mine. The simplest is just to attach an output line (accessed through a latch) to a sounder. It's then simple to, in software, toggle the line on and off at a reasonable speed (say 1KHz) to generate a tone. But much better then this is to use the system clock, and a programmed divider/counter to automatically toggle the output pin. That way you only need to write to a port once to generate a continuous tone at a particular frequency. Even better then this would be a system which uses a second register to hold a duration - the amount of time the tone should be played for. This is what I've started to implement, and have mostly working in prototype form. It requires quite a fair chunk of the resources available to a simple CPLD like the XC9572, since it has to include several counters and some comparators.

So a summary of the "features" for my "custom IC":
  • Address decoding:
    • RAM, ROM, DUART and IDE outputs
    • 8 expansion selects
    • 8 address inputs (the high byte of the bus)
  • READ, WRITE generation via E, Q and R/W inputs
  • RESET generation
  • IDE latch to fascilitate 16 bit IDE transfers
  • RAM bank switching latch
  • Interrupt routing:
    • DUART and IDE on the SBC
    • 4 expansion inputs
    • General purpose button for, say, NMI generation
  • ROM write-protect control via jumpers
  • Sound output line
To facilitate the two latches, and the sound output, the device needs to receive the full databus and A0 (giving two registers per decoded device).

The circuit for the computer main board currently looks like the following:


I've made quite a bit of progress on the PCB, but it isn't quite finished yet:

It is certainly more "dense" then the previous PCB, and a few cm bigger in both directions. You can see the vast number of vias needed around the CPLD, and the 9 pin serial port on the right. I've yet to finish the power supply details; I may yet change my mind and use a more traditional power connector instead of USB (or I may use both). You can also see that this time I have remembered some mounting holes!

This is very much a work in progress, and I don't intend to do any more work on this PCB until I have the whole circuit, and the VHDL code for the CPLD, running on breadboard.

Talking of PCBs, the other thing I have been doing is setting myself up to make PCBs at home. Not complex (relatively speaking) 2 layer boards like the one for the 6809 computer, but things like breadboard adapters and simpler circuits including things like AVR microcontrollers, etc.

So I have bought some of the things I need to try something I've not done since my school days. So far the results look quite positive. Before lordbubsy offered to send me a XC95108 breakout PCB, I had a go at creating a PCB from his design for such a board:


The result looks quite good I think! It's obviously got some issues, but considering this was my first attempt, and could probably be made to work with a few touchups, I'm quite pleased. I am using Ferric Chloride and the toner transfer method. It is actually the toner transfer part which is causing me the trouble with the "blotches". Most likely I need to use better quality paper, so I can get cleaner transfers. The actual etch of the PCB worked very well.

I still need to buy a few thing to be able to make useable PCBs, most noticeably a small pillar drill. But it is quite a lot of fun making up simple PCBs. I will probably write a more detailed account when I am in a position to start and finish a completed PCB design.

Since I will soon have a nice XC95108 adapter, the first PCB I will make (and drill) will be an adapter for the Shrink-DIP Yamaha video controller. This will then be the first daughter board I work on prototyping on breadboard.

But before that can happen I need to prototype the main computer.... And finish my VHDL.