Simple Logic Operation
 
 

Purpose: To get aquainted to the ispDesignEXPERT software, and the ABEL programming by doing some simple logic operations. Let us say for example that we want a LED to lighten when we press two switches from the board.

Procedure:
Double click on the ISP Design Expert icon. The ISP Design Expert window will appear. This is how it looks like:

 
 
 
  Click on the 'File' tab and select ' New project '. When prompted to save the newly created project, I saved it as "1.syn". We can change the Name of the project by double clicking the upper icon in the sources box. The default device is (ispLSI5384VA-125LB388). We change the type of device by double clicking on the yellow CPLD icon:  
   
 
If you get some messages like this choose OK and then confirm the change by choosing "Yes":
 
   
 
We add a new source by choosing 'Source' and then 'New...' and then 'ABEL HDL Module'. I chose the module name "semo2" and the title "test". Then choose OK. We see that there is some automatic code generated. This is how the Text Editor looks like:
 
   
 
You can see the program in the capture above or you can download it from here: test.abl
 
 
Select the device (M4-64/32-15JC) from the left pane and double click the 'Constraint Editor' on the Right pane. Once the constraint editor has initialized, select ' LOC ' from the toolbar to assign the correct PIN numbers to the switches and segments ( the box next to the Output must be checked in order to get the full list of the segments). Use the " pin out of the CPLD (both MACH4-32/32 and MACH4-64/32) on the development board " datasheet from the Digital Systems Lab web server for the correct pin assignments.
!REMARK: when assigning the pins use the leftmost column of the table to get the correct pin numbers. DO NOT use the second one. The first time when I did the program I made the wrong associations and got compilation errors.
 
   
 
The image above represents the "Location assignment" window. Once all the pins and switches have been assigned, minimize the constraint editor, plug in the JTAG download cable into the parallel port of the laptop, connect the power supply to the development board and run ' Fit Design ' (found on the right navigator window of the ispDesignExpert) by double clicking on it. Once the ' Fit Design ' has completed, a JEDEC file by the name of ' 1.jed ' was created in the same directory as the "test.abl'.

The next step involves downloading the design on to the M4-64/32 CPLD on the development board. In order to do this, run the ' ispVM System '. With the power supply connected to the development board and the JTAG download cable connected to the laptop, click on ' Scan ' in the toolbar to automatically detect the CPLD on the development board. Once the M4-64/32 appears on the device list, double click on it to get the device information dialog box. The image below is a capture from the ispVM System:

 
   
 
You can change the description for the device manually and change the path for the .jed file:
 
   
 
After specifying the JED file click on OK, click on the ' Go ' in the toolbar to begin the download. Once the download is completed you are ready to test the system.
 
 

Observations:

-No Seven Segment Display is on
-if we press SW1 and SW2 the U22A goes on
-NO SSD goes on if we press only one switch

 
 

Problems and Conclusion:

When we have a look on the code we can see the line:
U22A = sw1 # sw2;
The # is the "or" operator, so why do we get the SSD light only when sw1 and sw2 are pressed and not when sw1 or sw2 is pressed?
It's TRIVIAL, the answer is obvious if you had worked with this MACH 4 device before ( a jolly good fellow would say: "Elementary my dear Watson" :)). But I hadn't worked with it before so I was as astonished as any beginner in ABEL programming would be. It is because all the pins and segment are actually ' active low ' and not ' active high '. You can correct this problem by simply negating (!) the switches and segments in the PIN description part of the program.
I also did bad pin associations because I did not use the first column of the pin sheet. (see the remark).
There were also some minor problems related to syntax or bad hardware configuration but this always happens when you are a beginner
.

 
 
Internet

The movie of the experiment - this is the .avi demonstration of how the program works.