Close

First steps with programmable logic devices

A project log for rosco_m68k

A full-featured Motorola 68k retro computer, starring a 68010 running at 10MHz

ross-bamfordRoss Bamford 07/15/2019 at 19:043 Comments

I'm starting to become really nervous about the breadboard-based nature of the project as it grows and becomes more complex. This was really brought home to me a few weeks ago when I had to transport the board to work where I was demoing it to some interested colleagues - the transport went fine and the board made it there and back in one piece, but it was pretty nerve-wracking plugging it in a hoping it still worked!

For this reason, I've started to think about doing a PCB design with the board as it stands today. This would have expansion bus capabilities, allowing me to continue to design new bits (e.g. graphics) on breadboard, but would cement the working core of the computer onto a proper, reliable board.

Before I can do that though, I've decided to revisit some of my earlier decisions in light of this new plan - specifically, the address decoder and glue logic should probably be handled by programmable logic rather than discreet logic as they currently are.

The current design (with lots of 7400-series chips) works well, but is pretty power-hungry and takes up a lot of board space. Previously this didn't really matter, but if I'm now going to be spending $5-$10 per square inch of board space, I want to make sure I'm making the most of those inches. Replacing many of the fourteen 7400s with two or three PLDs makes a lot of sense now - it'll mean cheaper boards, and less soldering when the time comes to assemble them.

My reason for using discrete logic initially was for the learning experience, and I'm really glad I did it. I'm a lot more familiar with the 7400-series now, and have become used to designing circuits with them. I've found numerous uses for them in other projects too.

But going forward, it's time to cut the chip count. With that in mind, I've gotten hold of a bunch of Atmel ATF16V8BQL CPLDs, and started learning to use them (I've never done CPLDs before, so all good for more learning!)

My first stab has been the address decoder (CUPL code here - but go easy on me, this is my first time!) and, in basic testing, it seems to work exactly as it should. It even fixes a couple of bugs in the existing address decoder, including making the EXPANSIONSEL line work sanely and gating the whole thing off with the CPU's /AS line.

Even better, it now takes up one twenty-pin DIP rather than a whole bunch of 14-pin DIPs, and uses less power. I've not actually integrated it into the build yet so may find it doesn't work in some horrible way, but according to the datasheet it should be plenty fast enough (faster than the discreet logic design) and as I say in manual testing it seems to perform perfectly, so I'm not expecting any big surprises (I know, I know, famous last words...)

Discussions

Dave's Dev Lab wrote 08/07/2019 at 05:59 point

so CUPL actually has a function "decodes" specifically for decoding addresses! i found this out just recently. here is an example of decoding address 0x300:

Name     isa-decode ;
PartNo   00 ;
Date     7/29/2019 ;
Revision 01 ;
Designer David Anders ;
Company  Dave's Dev Lab ;
Assembly None ;
Location  ;
Device   g16v8a ;

PIN [2..9] = [ a3..10] ;
PIN 12 = WRITE_SEL ;
PIN 1 = !IOW ;
FIELD address = [ a10..3] ;
TABLE address = > decodes {
0300 => 'b'1;
}

WRITE_SEL = IOW&decodes ;

  Are you sure? yes | no

Ross Bamford wrote 08/07/2019 at 07:10 point

Thanks for the tip! I've played around with the table decoding, but found that the upper/lower data strobes and (especially) the BOOT line requirement I have made it too complex, and I couldn't get it to work on the 16V8s I'm using. I suspect if I moved to 22V10s it might work, so I'll definitely keep it in mind :)

  Are you sure? yes | no

Dave's Dev Lab wrote 08/07/2019 at 16:56 point

what kind of problem were you seeing? remember pins 1 and 11 only work in "complex" mode, which CUPL determines by how they are using in the code (not always apparent)....

  Are you sure? yes | no