Let's talk about resources - which are far more scarce on our chosen target (the lowly CPLD) compared to its larger cousin the FPGA.
I had a couple Xilinx Coolrunner II CPLDs in my parts bin - I bought them on a whim since they were cheap and interesting (this is the CPLD folks used for that so-called XBox Glitch hack, the xc2c64a). Their stats: 64 macrocells, and 33 I/Os. Well, that won't cut it for our purposes - we need 10 I/Os for VGA @ 8-bit color, 8 I/Os for our memory I/O line and... 19 I/Os for the address.
Not happening. The I/O crunch got us.
So, I bought some 72 Macrocell Xilinx CPLDs, XC9572s, on eBay. (And destroyed a couple soldering them to .5mm pitch breakout boards.) These chips are 64-TQFPs, with 52 I/Os and 72 macrocells.
I did all my math again (with some secret math I'll reveal in my first demo), and came up with... 53 I/Os. Well, that's fine - we can multiplex, right?
Well, let's talk about those Macrocells. As you may know, each Macrocell contains a single flip-flop:
Secret Section (I'll get to it in another entry):
Ring Counter (7 Flip Flop )
SPI Input:
0 - 639 counter for X (10 FF)
0 - 480 counter for Y (9 FF)
8 bit shift register (8 FF)
VGA:
0 - 799 counter for X (10 FF)
0 - 525 counter for Y (10 FF)
10 Bit Output Register (RRRGGGBB Hsync Vsync)
Great, 64 flip flops, right? Plus another 4 to switch clock domains between SPI & the VGA clock?
Nope - you need to put an address on the bus - when you read/write the RAM - so add another 19 FF.
I started thinking about arbitration schemes with putting the addresses on different lines with multiplexers and transceivers and tricks in VHDL/Verilog (including the ability to do things like A <= B and B <= A to switch without a temp variable)... and the silicon inflation became a bit annoying ("well, I'll just buy 3 multiplexers...").
So, maybe I'll do something clever eventually with a bunch of 7400 logic, but we've reasoned our way into the right size for the looming deadline of the Hackaday project: the 144 Macrocell, 81 User I/O XC95144XL in a 100-tqfp with 5v tolerant I/O (sure to make the Arduino crowd happy). $5.80 at Digikey.
So, there's my thought process for settling on that part - with a bit of a fun story about "ready, fire, aim."
Stay tuned for some pictures in a couple days - I've got some demos I'm documenting.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.