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



Wednesday, June 24, 2020

Atmel ATF1504AS(L) CPLD Development Board - Part 3 - Development Software and Tools

One of the most annoying things about the Atmel CPLD's is that their ProChip Designer software is basically not available unless you pay hundreds of dollars.  However for all of you makers out there the only real money you'll have to spend will need to be on the programmer.  So lets have a look and see how this all works.

Just some things to note
  • Microchip bought Atmel, I will refer to them as Atmel (not much rebranding has been done).
  • Intel bought Altera, I will refer to them as Intel.

Getting Started

These are all of the resources that I will be using to get / setup / write and upload the software.
You can skip them for now. If you used the same parts I did, you will be able to just follow along.
It's important to note that where possible I will use alternate and freely available or cheap parts where possible.

PDF Resources

Software Resources :
Hardware Resources

Pin compatible parts and converters

For this project we will be using Verilog/VHDL the best thing about this is we can use alternate vendors software for the development environment and then convert it over to a compatible programming file.

Intel Compatibility

I specifically bought this part ATF1504AS-10JU44-ND.
The conversion according to the Atmel : ATF15xx Product Family Conversion is the following:

 Intel AtmelPOF2JED Version
 7064SLC44 1504AS-J44  3.30

This means I can use software normally used to program the 7064 Intel CPLD.


Get and Install  : Intel Development Environment

The Intel 7064 is a 7000 series Max CPLD so lets go to the Intel download site Intel Quartus Legacy Software and grab the latest version of Quartus that supports the 7000 Max series of CPLD.

Get Quartus 13.0 SP1 Web Edition. You do not need to get a license for the Web Edition. Download the ISO file so you can get it in one easy to install package. It is the same package for Windows and Linux.

I installed the 13.0 SP 1 Windows version on Windows 10.


Get and Install : Atmel POF2JED

Quartus produces a POF programming file, however to use Atmels programmer you need a JED file so get this software to do the conversion.

Go here Atmel : POF2JED and download and install POF2JED.

Get and Install : Atmel ATMISP v7.3

Atmels programmer "ATDH1150USB" needs ATMISP v7.3 to program the CPLD.

Go here Atmel : ATMISP v7.3 (for Windows 7, 8 and 10) and download and installed ATMISP v7.3

Get some test programs

https://radzaeem.gitbooks.io/altera-max-ii-cpld-tutorial/led-blink.html

https://learn.digilentinc.com/Documents/242

USB Programmer

I am using the rather expensive ATDH1150USB programmer.

However recently I saw this blog entry on Hackup.net where he built his own programmer and used OpenOCD to program the chip.  I will have a go at building and programming the Dev board with this as well in a later blog entry.














Atmel ATF1504AS(L) CPLD Development Board - Part 2 - Building the Dev Board

Let's build the CPLD development board so we can have some fun.

Order the board

You can get the board from PCBWay: ATF1504AS(L) CPLD Development Board.

If buy from PCBWay via the above link you'll be supporting me cover my prototyping mishaps.

If not you can just download the Gerbers and choose your own manufacturer of choice.

Order the parts

You will need the following parts ( or similar ).

 TagPart
 No
 - ATF1504AS-10JU44-ND CPLD
 1
 U1 PLCC Socket 44 pin
 1
 J1 JTAG Header
 1
 J2 Power Barrel Jack
 1
 C1 Capacitor SMD 0805 10uF
 1
 C2,3,4,5 Capacitor SMD 0805 0.1uF 4
R 1, 2, 3 Resistor SMD 0805 4.7K
 3
R 4 Resistor SMD 0805 10K
 1
J4,5
 Header Female 16 pin           
 2
 J3 Header Female 6 pin     1
 J6 Header Male 2 pin
 1

Build the board

Solder on all of the surface mount parts first
Solder on the PLCC socket
Solder on the remaining parts in any order
Insert the CPLD

Surface Mount Soldering

Don't be afraid of Surface Mount Device soldering (SMD), once you know the tricks you will find that it is actually much easier and cleaner than Through Hole soldering (TH).

I use the same chisel tip on my soldering iron for SMD as I do for TH.  It is important with SMD not to use too fine a tip, especially if you have a large pad or surrounding copper as the heat will quickly vanish.
  • Add solder to one pad of each pair first.
  • With some tweezers move the SMD part into the soldered pad with one hand while re-heating the solder with the other hand.  Then ensure the part is flat on the board by pushing down lightly and re-heating.
  • Lastly solder the other pad to the part.
Tip: When removing the soldering iron, do so quickly. This stops little legs forming. 
Tip: Hold the part in place for one second after removing the heat or it will move.