Thursday, November 30, 2023

XC9536 LED Blinking Using VHDL

In this introductory VHDL coding, I use frequency divider to make a 1 second pulse duration. That pulse will drive and output LED high and low. I use an obsoleted part XC9536 CPLD manufactured by Xilinx. It was released in early 2000s. At that time we only requires a DIY legacy parallel port JTAG to program this Flash-based CPLD.







XC9536 LED Blinking Using VHDL
XC9536 Test Board

Clock source is fed by a NE555 oscillator circuit with a frequency of 60Hz. I use a sequential process block to count clock pulse, and LED controlling. A counter variable store, and increase counting value. Whenever it reaches 60 counts it will rolls back to 0. The output LED will toggle its logic state.

  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 15:30:25 11/30/2023
  6. -- Design Name:
  7. -- Module Name: LED_BLINK - Behavioral
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20. library IEEE;
  21. use IEEE.STD_LOGIC_1164.ALL;
  22.  
  23. -- Uncomment the following library declaration if using
  24. -- arithmetic functions with Signed or Unsigned values
  25. --use IEEE.NUMERIC_STD.ALL;
  26.  
  27. -- Uncomment the following library declaration if instantiating
  28. -- any Xilinx primitives in this code.
  29. --library UNISIM;
  30. --use UNISIM.VComponents.all;
  31.  
  32. entity LED_BLINK is
  33. Port ( CLK : in STD_LOGIC;
  34. LED : inout STD_LOGIC);
  35. end LED_BLINK;
  36.  
  37. architecture Behavioral of LED_BLINK is
  38.  
  39. begin
  40.  
  41. FREQ_DIV: process(CLK)
  42. variable counter : INTEGER RANGE 0 TO 99;
  43. BEGIN
  44. if(CLK'EVENT AND CLK='1') THEN
  45. counter:=counter+1;
  46. if(counter>=60) THEN
  47. counter:=0;
  48. LED<=LED XOR '1';
  49. end if;
  50. end if;
  51. END process FREQ_DIV;
  52.  
  53. end Behavioral;
  54.  
  55.  

I add a User Constraints File (*.ucf) file for CPLD I/O assignment.

#PACE: Start of Constraints generated by PACE
#PACE: Start of PACE I/O Pin Assignments
NET "CLK"  LOC = "P5"  ;
NET "LED"  LOC = "P40"  ;
#PACE: Start of PACE Area Constraints
#PACE: Start of PACE Prohibit Constraints
#PACE: End of Constraints generated by PACE

 

Without simulation in iSIM, I use ISE Impact to program the XC9536 CPLD. I use Xilinx ISE Design Suite 14.7 (nt64) on Microsoft Windows 10.

XC9536 LED Blinking Using VHDL
Xilinx ISE Design 14.7


XC9536 LED Blinking Using VHDL
Xilinx ISE Design Suite 14.7


XC9536 LED Blinking Using VHDL
ISE iMPACT With USB Platform Cable

On Microsoft Windows 10, I use the Xilinx Platform USB Cable JTAG interface to program the target CPLD. Legacy parallel port JTAG cable was tested and it works find on Microsoft Windows 7 64-bit. However I have not yet test this legacy JTAG interface on Microsoft Windows 10.

XC9536 LED Blinking Using VHDL
After JTAG Programmed

Click here to download its source.



No comments:

Post a Comment

Labels

ADC (10) Analog (14) Arduino (12) Atmega16 (19) Audio (2) AVR (20) Charger (1) Cortex-M0 (1) Counter (10) CPLD (25) Digital I/O (22) Display (34) EEPROM (2) Environment Sensor (1) esp8266 (2) Experiment Board (10) I2C (4) Interrupt (7) LCD (1) LDmicro (29) measurement and instrumentation (7) Microchip Studio (3) MikroC (1) One-Shot (3) OpAmp (1) PCB (31) PIC16 Microcontrollers (16) PIC16F877A (2) PIC16F887 MikroC (22) PLC (35) PWM (11) Regulator (1) RTC (2) Sensor (8) Shift Registers (5) SPI (5) Timer (34) UART (2) ultra-sonic sensor (1) USB (1) VHDL (21) xc8 (1) XC95108 (9) XC9536 (15) XC9572 (1) Xilinx (23) Xilinx ISE (22)