FPGA hacks

I got my first FPGA board, a Digilent Nexys 2 500K, on 2011-05-13. Learned a lot of the basics from fpga4fun and its tutorial projects. Since 2011-07-13 I also have a Terasic DE2-115. There is a separate page on getting these to work on Linux.

Public projects


Nexys 2 UCFs

There are UCFs around for the Nexys2, but IMHO it is simple to use the manual to find out the pins. Many of the pin codes are even printed on the board. For example, here is a working UCF to use with the PWM DAC.

Serial ports

Serial ports are a nice and simple way to communicate with an FPGA. Most computers today come without an RS232 port, but motherboards often have the header nevertheless, which is worth checking. I generally use pyserial at the computer end, and fpga4fun's async code on the FPGA.

TTL level serial

This "legacy" port keeps popping up in other modern devices. Many "embedded" systems such as modems and NAS boxes have TTL level serial, usually as a "diagnostic port" in a hidden location. Contrary to the peculiar levels of RS232, their logical one is 3.3 V and zero 0 V. Generally, they only have these data lines, plus a 3.3 V source. With a level converter, for example an old Nokia cable, these can communicate with RS232.

However, if both ends of the line have TTL levels, there is no need to convert into RS232 in between. You can use any general I/O pins of an FPGA as the port, with appropriate signaling.

The only caveat, in my experience, is with the available I/O levels of the FPGA. For example, a Spartan 3E can be set to operate at 3.3 V TTL levels. However, the Nexys2 FPGA is powered at 2.5 V, so this level is not available. Consequently, it can receive TTL serial fine, but sending is erratic. On the other hand, the 14-pin port of DE2-115 is set at 3.3 V by default, and it works fine with my NAS.

DE2-115 cooling mod

The FPGA miner needs a heatsink to operate at a high frequency (currently 109 MHz). For starters, the plexiglass cover needs to be removed. There are no mounting aids such as holes near the chip, so a little creativity is required.

I had a Zalman ZM-NB47J available, having just the right size, power and colour ;) With appropriate thermal paste, the heatsink stays put without any special mounting on a flat surface, but I wanted to keep my precious FPGA a little safer. A replacement for the plexiglass was cut from a plastic sheet, with a tight-fitting square hole to keep the heatsink in place laterally. I later expanded the sides for better airflow, keeping the corners tight. There is also a stack of translucent red Legos over the power LED, as the bright blue is annoying as such.

DE2-115 with ZM-NB47J

Further resources and fun links

Risto A. Paju