Thursday, June 25, 2020

Atmel ATF1504AS(L) CPLD Development Board - Part 4 - Write an example program and Program the CPLD

For a basic demonstration we will write a small piece of code to demonstrate the CPLD Dev board is working.  This code will use a single switch to turn on and off some LEDs.


Create a Quartus project

Start up Quartus 13.1 on your computer and we will create a new project from scratch.

  • File => New Project Wizard

  • Enter the project details and Next>
 Working Directory
 C:\altera\projects\swtichled_cpld
 Project Name
 switchLed
 Top-level Entity
 switchLed



  • Click Yes


  • Click Next>

  • Enter the following Details and Click Finish
 Family     7000s
 Package PLCC
 Pin count
 44
 Available Devices
 EPM7064SLC44-5


  • Open the pin planner

  • Setup the following pins with "node name" and "location"


  • Create the top level Design file, Click OK, Click OK and then close the pin planner




  • Double click to open the switchLed Entity


  • Replace the file contents with this! and save it

 `timescale 1ns/1ps

module switchLed
(
    output led1, led2,
    input switch1
);

assign led1 = switch1;
assign led2 = !switch1;

endmodule


  • Compile the code by double clicking on Assembler

  • You should end up with two warnings, but it will be successful.

  • You should now have a .pof file in the output directory.
       


Create the Jed file using POF2JED

  • Startup POF2JED and enter these details and click "Run"
Input File
 C:\altera\projects\swtichled_cpld\output_files\switchLed.pof
 Device 1504AS
Output File
 C:\altera\projects\swtichled_cpld\output_files\switchLed.jed


Program the CPLD using ATMISP v7.3

  • Attach the ATDH1150USK-K programmer to the Dev board and your computer



  • Startup ATMISP v7.3 and Click on Edit => Add New Device and Click OK


  • Enter the following details and Click OK
 Device Name
 ATF1504AS
 JTAG Instruction
 Program/Verify
 JEDEC File
 C:\altera\projects\swtichled_cpld\output_files\switchLed.jed




  • Now click Run


  • It should finish with success, time to move on to the next step