標籤:
此篇開始正式對套件進行評測,先拿官方提供的參考設計練練手,在上一篇博文中給出了參考設計連結:https://cloud.altera.com/devstore/board/max-10-fpga-evaluation-kit/
在此頁面中,有如下幾個設計▼
適用於QuartusII 14.1版本的設計如下:
l ADC /LCD Controller Design Example :ADC/LCD控制器設計
l Custom Instruction for NIOS II Processor :NIOS II處理器自訂指令設計
l Dualboot Design Example :雙啟動設計
l MAX 10 Evaluation Kit Baseline Design :基本參考設計
l On-die Temperature Sensor Design Example :溫度感應器設計
l On-die Temperature Sensor/LCD Design Example :溫度感應器/LCD設計
l PWM Design :脈衝調製設計
l Restore Factory Settings LED Flash :出廠內建的LED閃爍設計
l Stepper Motor Controller (AN 488) :步進電機控制器
開啟其中一個設計,如Restore Factory Settings LED Flash ▼
點擊Download可下載此參考設計,下載得到LED_Flash.par檔案,此檔案為設計範本,可匯入QuartusII 14.1中:
▼開啟QuartusII,點擊功能表列File中Open Project選項
▼進入建立工程嚮導,設定工程路徑
▼在工程類型中,選擇工程模板 Project Template
▼在可用設計範本列表中並沒有下載的LED_FALSH參考設計,需要先添加,點擊紅框中Install the design templates
▼選擇LED_FALSH.par檔案,並設定工程路徑
▼添加完成後,Restore Factory Settings LED Flash就出現在可用設計範本列表中了。
▼點擊Finish,匯入LED_FLASH設計完成
▼參考設計中包含的原始碼,LED_Flash_all.v包含功能代碼,LED_Flash.sdc包含時序約束
▼開啟LED_Flash_all.v,分析代碼,簡單的時鐘分頻,功能是LED1~LED5每秒亮、滅一次
1 `timescale 1ns / 1ps 2 ////////////////////////////////////////////////////////////////////////////////// 3 // Company: Axelsys 4 // Engineer: Greg Miller 5 // 6 // Create Date: 11:21:08 08/21/2014 7 // Design Name: LED 8 // Module Name: LED_Verilog 9 // Project Name: Altera MAX10 Breakout Board10 // Target Devices: 10M08SAE144C7G11 // Tool versions: 14.012 // Description: 13 // LEDs, D1 through D5 will blink on for 1/2 second and off for 1/2 second.14 // Clock is operating at 50MHz.15 // 16 // Dependencies: 17 //18 // Revision: 19 // Revision 0.01 - File Created20 // Additional Comments: 21 //22 //////////////////////////////////////////////////////////////////////////////////23 module LED_Flash_all(24 input clk,25 output LED1,26 output LED2,27 output LED3,28 output LED4,29 output LED530 );31 32 reg[15:0] div_cntr1;33 reg[9:0] div_cntr2;34 reg dec_cntr;35 reg half_sec_pulse;36 37 initial begin38 div_cntr1 = 0;39 div_cntr2 = 0;40 dec_cntr = 0;41 end 42 43 always@(posedge clk)44 begin45 div_cntr1 <= div_cntr1 + 1;46 if (div_cntr1 == 0) 47 if (div_cntr2 == 762) 48 begin49 div_cntr2 <= 0;50 half_sec_pulse <= 1; 51 end52 else53 div_cntr2 <= div_cntr2 + 1;54 else55 half_sec_pulse <= 0;56 57 if (half_sec_pulse == 1) 58 dec_cntr <= !dec_cntr;59 60 end 61 62 assign LED1 = dec_cntr ;63 assign LED2 = dec_cntr ;64 assign LED3 = dec_cntr ;65 assign LED4 = dec_cntr;66 assign LED5 = dec_cntr ;67 68 endmodule
▼工程中已包含引腳分配
▼工程編譯後報告,無報錯
▼MAX10評估板與USB Blaster下載線正確串連後並上電,開啟Programmer,點擊Auto Detect自動識別JTAG鏈上的器件,然後添加LED_FLASH.sof檔案,點擊Start開始下載,下載成功後會在進度條中顯示100%(Successful)。
以上以LED_FALSH參考設計為例,對MAX10評估板整套開發系統做了示範。
【MAX10評測】(三)參考設計