Forum Discussion
Altera_Forum
Honored Contributor
12 years agoHere, try this example to get you started (its in VHDL, but it should be easy enough for you to understand), and then use the tutorial I linked to above. You can use that to read a PIO (your button) and to write PIOs (LEDs).
Cyclone IV GX Starter Kit (C4GXSK) 'basic' design
-------------------------------------------------
3/20/2013 D. W. Hawkins (dwh@ovro.caltech.edu)
This top-level basic design can be used as a template for all
other C4GXSK designs.
1. Unzip the zip file, eg., into
c:/temp/c4gxsk_basic/
2. Start Quartus II (eg., 12.1sp1)
Select the Tcl console (it can be made visible using View->Utility Windows->Tcl Console)
Change directory to the zip folder
tcl> cd c:/temp/c4gxsk_basic
or if you like to copy-and-paste from the Windows Exporer
path, you can use paranthesis to 'escape' the windows path format
tcl> cd {c:\temp\c4gxsk_basic}
3. Run the synthesis script
tcl> source scripts/synth.tcl
and you will see the output:
Synthesizing the C4GXSK 'basic' design
--------------------------------------
- Quartus Version 12.1 Build 243 01/31/2013 Service Pack 1 SJ Full Version
- Creating the Quartus work directory
* C:/temp/c4gxsk_basic/qwork
- Creating the design files list
* create a new c4gxsk project
- Applying constraints
- Processing the design
- Processing completed
The Quartus messages window outputs a few warnings.
related to invalid fitter assignments. Those warnings are due to
the transceiver channel pin assignments that need to be commented
out, since Quartus does not allow you to simply disable (tri-state)
those pins (you have to connect them to a transceiver block).
4. Download the design to your board.
Per the comments in the top-level file src/c4gxsk.vhd
-- This basic design implements the following;
--
-- * LED connected to PB
-- * LED blinked by a counter clocked by the 50MHz osc
-- * LED blinked by a counter clocked by the 125MHz osc
--
Enjoy!
Cheers,
Dave
Cheers, Dave