Programming CPLD using Schematic without programming knowledge - without a single line of code
Here I will show you the quick tutorial on how to program altera CPLD in Intel Quartus using a working digital Schematic. Imagine you have a working but very complicated digital circuitry containing many digital chips and you need to make it more compact or cheaper, but you can not programm VHDL or Verilog code. It can be created just with schematic and I will show you how to do it. For demonstration we can use the cheap CPLD from aliexpress with programmer, just search EPM240T100C5, like this one for 10€:
https://www.aliexpress.com/item/1005004872591240.html
And it gets maybe even cheaper, just search. It is cheap but very powerful. It is so powerful, that you can use custom external oscillators, you can connect it with another CPUs, you can multiplex signals, use buttons, do some computations and so on.
Download and install Intel Quartus 13 Web Edition (free)
You must have Intel Quartus installed, install web edition version 13, which I have verified and works.
I had problems with the latest version 23.1 where simulations didn't work properly.
Download Intel Quartus 13 Web edition:
https://www.intel.com/content/www/us/en/software-kit/666221/intel-quartus-ii-web-edition-design-software-version-13-1-for-windows.html
Unpack downloaded file and you will see multiple files. Start the installation with QuartusSetupWeb-13.1.0.162.exe with default settings.
Download and install update QuartusSetup-13.1.1.166_update.exe
Open Quartus and select "Run the Quartus II Software". Close Quartus.
Click Start - Altera 13 - Quartus II 13.1 Device Installer
Browse for the directory where the max_web-13.1.0.162.qdz is located and click Next.
Select all devices or only MAX II/V and click Next, Next and wait for installation complete.
Create first project "I2S to PCM"
Open Quartus
File - New Project Wizard - Next
Create and choose main working directory (Use whole name for directory without spaces and never use symbol "-", create folder like AlteraProjects)
For each project create new project folder inside this main working directory, for this case I2S_to_PCM. The complete working directory for this folder is this:
C:/AlteraProjects/I2S_to_PCM
Type name of the project "I2S_to_PCM" (avoid spaces or use whole name) and click Next, Next
Select family MAX II, select device EPM240T100C5 and click Next, Next, Finish
Create schematic for 20-bit I2S to PCM converter for AD1862 DAC
Here is the schematic, from which we transfer the digital logic into altera:
https://www.diyaudio.com/community/attachments/diyaudio_ad1862_dac_v1-3_uf-l_schematic-jpg.1117360/
File - New - Block Diagram/Schematic File and click OK
Double click in the schematic window and list for the 74164 device (others - maxplus2 - ...) and click OK
Place the 74164 in the schematic window and continue with placement to have 6 devices, like in the DAC schematic.
Double click in the schematic and insert Pin input (primitives - pin - ...), insert 3 inputs and 4 outputs, and rename it properly (inBCK, inDATA, inLRCK for inputs .... outBCK, outLR, outDR, outLE for outputs).
Periodically save the schematic file.
Double click in the schematic and add 3 input buffers (alt_inbuf) and 4 output buffers (alt_outbuf). These buffers can be omitted, but I recommend using it (primitives - buffer - ...).
Double click in the schematic and add vcc component (primitives - other - ...).
Connect all components together with wires to match the original schematis.
This is the final result:
https://drive.google.com/file/d/1E4cIA_fQon1rUkHLFfvCGXSWZCralT1j/view?usp=sharing
Compile schematic and assign pins
Click Processing - Start Compilation
This is how the Compilation Result looks like:
https://drive.google.com/file/d/1Ng9vSE5KCTrZ-cyH3_v_QO8v0R4_rJnK/view?usp=sharing
Go back to the schematic window and click Assigments - Pin Planner
Assign inputs and outputs to the Altera pins in Location, this is the result:
https://drive.google.com/file/d/1L03IWLdXAw6O3ng0AvG9LqvPJS-9A6Rx/view?usp=sharing
Click on File - Close
In the schematic each input and output pin has the pin number assigned:
https://drive.google.com/file/d/1v62lb2z7H4xCuP82PJo4c6cA7UQmZ8Rq/view?usp=sharing
Compile the project again, click Processing - Start Compilation
Now the project is complete and prepared for transfering into the CPLD using the programmer device.
Programming CPLD with Altera programmer device
Follow this tutorial from step 13 to step 13 for drivers installation.
https://electrodac.blogspot.com/p/i2s-to-pcm-dac-converter-tutorial-cpld.html
Note that this tutorial is written in different version of Quartus, just adapt names to the version.
Continue with steps 24 - 30.
Now the CPLD is programmed and prepared for real testing.
Useful links
Completed project for download:
https://drive.google.com/file/d/1vj2gq-qkaQq5V1NotZif9YC1_157IEXP/view?usp=sharing
Comments
Post a Comment