close-circle
Close
0%
0%

Arduino + CPLD = CPLD Fun Board!

Homemade low cost CPLD dev board (Arduino STM32F103 and Altera MAX II EPM240/EPM570 CPLD)

Similar projects worth following
close
Two dev boards in one: a STM32 based Arduino and an Altera MAX II CPLD (EPM240T100C5N) dev board to start playing with VHDL/Verilog, or just to try to use a CPLD with the Quartus II schematic editor. The cost should be about 5/6$ plus the PCB (I haven't done the precise BOM calculation yet...), buying the components "around". The "pluggable" LCD module and the optional stand-alone 50MHz oscillator aren't included in the cost count.

The basic idea is to have a STM32 Arduino to use as "stimulus generator" for the CPLD (e.g. I2C master) and an Altera MAX II CPLD on the same board. In this way is easier to set up a complete "test bench" for the CPLD "application" (e.g. your custom I2C interface).


The CPLD Fun board in action:

The STM32F103 MCU is used as "stimulus generator" and as 8/36MHz clock generator for the CPLD, and is easily programmed using the friendly Arduino IDE through the USB connector.

Five push buttons (RST, BUT, USER1-USER3) and a led (PB1) are reserved to the MCU.

The STM32F103 MCU side is "Maple Mini" compatible, so it possible to use the STM32F103 Arduino core provided by http://www.stm32duino.com (more info here). For a short story about the Maple Mini and the stm32duino see here.

You need to flash the bootloader first using a cheap "St-Link V2" dongle through the SWD connector (or using a serial-USB adapter on the SERIAL connector. More info here).


To configure the CPLD (an EPM240T100C5 with 240 LEs, enough for some fun...) it is used the Quartus II IDE (free Web edition) and a cheap "USB Blaster" dongle through the JTAG connector.


A 4 digit 7-segment led display, four push buttons (USER4-USER7) and four leds (LED1-LED4) are reserved to the CPLD. There is also a connector for a common and cheap 1602A or 2014A LCD 5V module (that probably you already have got...).

On the CPLD side there are also a DEV_CLRn push button to clear all the internal FFs, and a DEV_OE jumper to force all the CPLD pins in HiZ (to use these two functions you must explicit enable them first in the Quartus II IDE).

An optional on-board 50MHz oscillator is available too (not assembled in the previous photos), and there are also two connectors for external oscillators.

There are 22 I/O lines that "join" the STM32 and the CPLD, and on every of them there is a pin of three connectors (TEST1, TEST2 and TEST3). In this way it is possible "observe" signals exchanged between them with a scope or a LA. On this 22 I/O lines there are available various peripherals (e.g. serial, I2C, SPI) on the MCU side.

There are also others 25 GPIOs on the CPLD side (GPIO1 and GPIO2 connectors).

It is possible to make use for the Arduino STM32 or the CPLD as a stand-alone dev board, and use the TEST1-TEST3 connectors as normal GPIOs (holding the other chip pins in HiZ).

All this is shown in the following functional block diagram:


Typically, to program this board you need to use together the Arduino IDE for the MCU and the Quartus II IDE for the CPLD.

Here is a typical session (using the Quartus II schematic editor for the CPLD):

Of course you need two USB on you PC/Workstation, one to connect the Arduino IDE to the MCU USB (the STM32F103C8T6 MCU has an integrated USB peripheral) and one to connect the Quartus II IDE to the USB Blaster dongle to upload the CPLD "configuration" using JTAG.

Here is a typical session layout:



Project status

Currently I'm making a new PCB revision to correct some minor errors (e.g. there are a couple or errors on the silkscreen) and apply some little modifications. I'll release all the project details after the testing of the new PCB (when available).

  • New PCB will support EMP240 and EMP570 CPLDs...

    Just4Fun09/14/2017 at 09:09 0 comments

    I've just finished the new PCB revision:


    Using eight solder jumpers (SJ1-8) it is possible now "configure" the board to use an EPM240T100 or EPM570T100 CPLD (the idea to allow the choice between an EPM240 and EPM570 was suggest by Hacker404).

    In the back side there is a short note on how use the solder jumpers.

    I've also added a switch and a led for the DEV_OE signal, because using the previous board version I realized that it would have been more handy.

    Now some more checks before send the files to the PC service...

View project log

Enjoy this project?

Share

Discussions

Hacker404 wrote 7 days ago point

Looks good.

I feel a bit guilty now as I seem to remember some errata with a 5 Volt tolerant CPLD that I have used. I can't remember if it was with Xilinx XC9536XL / XC9572XL (QFP44) or Altera EPM240 / EPM570 (QFP100). I remember the data sheet had the pin functions on the left and the pin numbers for various packages on the right. It was a nightmare to read so it was not at all surprising that the document had errata.

So perhaps it might pay to check that your data sheet includes the errata correction before making the boards.

Love your work!

  Are you sure? yes | no

Hacker404 wrote 09/07/2017 at 09:07 point

This is looking good.

I guess you want five volt tollerant by your choice of the EPM240 as the cyclone II's are cheap now.

If you are redesigning the board you could also make it compatible with the EPM570 the has extra power/ground pins.

I usually run 5 Volt tollerant chips ate 3.6 Volts to improve noise margins.

  Are you sure? yes | no

Just4Fun wrote 09/07/2017 at 09:22 point

Thanks! The EPM570 costs too much compared with an about 1$ EPM240, so for that I think that it's better to switch to an entry level Cyclone II (probably next project...).

*UPDATE*

Just realized that an EPM570T100C5N can be found for about 3$ now... Hmmm...

  Are you sure? yes | no

Just4Fun wrote 09/14/2017 at 10:11 point

Said and done...! See the Log... :-)

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates