Hi, as I saw a lot of topics where the people are looking for challenging solutions where the Arduino itself cannot be fast or complex enough, I spent few hours playing with an XILINX CPLD - a free programmable hardware device, fast and cheap I've got this breakout board http://www.seeedstudio.com/depot/xc9572xl-cpld-development-board-v1b-p-799.html?cPath=174 , but you may get a lot of similar ones at ebay cheap.XC9572XL has got 34 free and 100% rootable 5V tolerant I/O pins and 72 logic cells so you can implement quite a complex wiring. As an example I've created a 32bit counter, which connected to Arduino can serve as a counter, frequency and period measurement gadget etc. The sketch is very simple - just controlling the CPLD and receiving the results (32bit counter value) and printing the results. Enclosed is the schematics of the counter (as I don't like to mess with VHDL ) as well.BTW, on an ordinary breadboard it measures up to 80MHz (maybe more - I found only an 80MHz canned oscillator in my junkbox..)p.

I did some improvements there - I've put an internal oscillator (ring oscillator) in the CPLD, which runs at ~135.27MHz. There is an additional NSEL pin (selects internal/external oscillator as the source of the signal for the counter, you may gate the sources with NGATE) see below.

When running (atmega @ 16MHZ) and counter is sourced from internal oscillator and I gate it without a delay: //gate the counter input fastDigitalWrite(NGATE, LOW); fastDigitalWrite(NGATE, HIGH); //I get CPLD counter= 17. So based on the internal oscillator frequency and counter value the delay between those two fastDigitalWrites measured is 125.67nSec. The internal CPLD ring osc. frequency has been measured with //gate the counter input fastDigitalWrite(NGATE, LOW); delay(1000); fastDigitalWrite(NGATE, HIGH); //and I read 135273234, stable on ~4-5 digits (the ring oscillator is temperature and voltage dependand).P.

@Graynomad - Xilinx will send you a DVD with the latest development package free of charge, just do register and request it. I got it in a ~week in my post.You need few GBytes free on your HDD, but frankly, when you understand digital the learning curve is steep as you need just learn few clicks with creating a project, select the device, then draw the schematics (like Eagle, but much simpler), assign the pins (few lines text file), synthetise/compile - one click), and flash (about 3-4 clicks). You need a programmer, I am using an LPT based one - 4diodes, 4resistors and 3V3 voltage reg.. and it works !

What has changed is the design environment. At home I used small 20-pin chips and the programmer cost $3500. Yikes! I still can't believe I spent that much on a programmer but all dev tools cost a lot then.

At work I used Altera 44-pin PLCC devices, I had to fly down to Sydney for a few days and design the internals on a mainframe CAD system.

Now we get a full dev system for free and run it on our laptops.

It's a brave new world alright.

BTW I used the 20-pin chips in my own dev product I sold, it was an EPROM emulator. Anyone remember EPROMs? Thanks goodness I don't depend on that income any more

I ahve kind of curious about CPLDs as they seem like an amazing design space and would like to give them a try the only concern is a compatible programmer. Could someone point me to programmers for that CPLD that I could use. It seems like I have collected a few boards and programmers over that never quite mated up with a development environment, now I try to reduce the rate at which components go in the box.