ãã®å°ããªã®ã£ãããåããŸãããã FPGAã§äœæéãç°¡åã«äœæ¥ã§ããããšãšãããã«å¿ èŠãªããŒããŠã§ã¢ãªãœãŒã¹ã確èªããŸãã ããã«ã64åã®ãã¯ãã»ã«ãšããéåžžã«å°ããªFPGAããããæäŸãããŸããã ããã¯ãç§ããããŸã§åããããšã®ãªãã©ãã£ã¹FPGA LC4064vã§ãã é¢çœããšæããŸãïŒ
ç®çïŒ
- ã¯ããã¯ã®ããžãã¯ãå°ããªFPGAïŒ64ãã¯ãã»ã«ïŒã«åããããšããŸãã
- æéåºåã®ããã®FPGAäžã®ãã¹ã¿ãŒéçãŸãã¯åçLED衚瀺ã
- ã¹ããŒã ã®èªå·±éçºã«é¢é£ããå€æ°ã®ã¬ãŒããåéããæ°ããçµéšãç²åŸããŸãã
- ã©ãã£ã¹FPGAã®æ°ããéçºããã³ããã°ã©ãã³ã°ç°å¢ãç¿åŸãã移è¡ã®è€éããè©äŸ¡ãã
FPGAéçºã«é¢ããéåžžã«æ¥œããå€ãéãããŸãïŒ
FPGAã©ãã£ã¹ã®ã¡ãŒã«ãŒã§ããïŒ
ã©ãã£ã¹ã»ãã³ã³ãã¯ã¿ãŒã³ãŒãã¬ãŒã·ã§ã³ã¯ãç±³åœã®ãã€ã¯ããããã¡ãŒã«ãŒã§ãã ãªã¬ãŽã³å·ã«ãããé«æ§èœFPGAã補é ããŠããŸãã ææžããããã³ã«ãå ¬éãããŠãããããç£æ¥éçºã«ãããŠè¶ å°ååè·¯ãæ®åããŠãããšããæ å ±ããããŸãã å¹ åºã補åãšãã®ã¢ããªã±ãŒã·ã§ã³ã¯ãèªååãèªåè»ãã³ã³ãã¯ãã§ããŒã¿ãã«ãçµæžçãªããã€ã¹ãäœæããããã®FPGAã·ãªãŒãºã補é ããããšã瀺åããŠããŸãã 倧容éã®FPGAã·ãªãŒãºïŒæ倧100k以äžã®ãã¯ãã»ã«ïŒããããŸãã
FPGAã©ãã£ã¹ã¯ã©ãã«ãããŸããïŒ
æ®å¿µãªããã1ã4,000ã«ãŒãã«ã®äŸ¡æ Œã§1ã4åãã¯ãã»ã«ã®FPGAãè³Œå ¥ã§ããåºããŸã èŠã€ããããšãã§ããŸããã§ããã ããããèŠä»¶ã«åã£ãããŒã- ããã°ã©ããã«ããžãã¯ICéçºããŒã«MachXO3LF StarterKitãèŠã€ããŸããã ã»ã«ã®æ°ã¯6900ã§ãããŒãã«ã¯ãã§ã«ããã°ã©ããŒïŒ FTDI ïŒã 8ã€ã®LEDããããŸã ã äŸ¡æ Œã¯25ãã«ã§ãããã©ãã£ã¹ã¹ãã¢ã§ã®ãã§ãã¯ã¢ãŠãæã®éæã¯45ãã«ã§ããã ãŸãããéããããŸã- ããžããŒãŸãã¯ããŠã¹ãæ¢ããŠãåæã«ãããããã¹ã¿ãŒããŸãã ããããèªå® ã®ãšãªã¿ã³åºã§ã¯ã2,992ã«ãŒãã«ã®äŸ¡æ Œã§ã®è³Œå ¥ãªãã·ã§ã³ããŸã ãããŸããã Ebay / Aliexpressã§ã¯ãéžæè¢ã¯ãŸã 倧ãããããŸãããã5000ã»ã«çšã®ããŒããªãã®ããããèŠã€ããããšãã§ããŸãã-LFXP2-5E-5QN208C
å€ãé»åæ©åšãå解ãããšãå°ããªãµã€ãºïŒ32ã64ã»ã«ïŒã®CPLDãå®æçã«çºçããŸãã ãã®ãããªãããã®1ã€ã¯ãç§ã®å人ããäžããããŸããã FPGA LC4064VïŒ pdf ïŒ -ispMACH 4000V / B / C / Zãã¡ã㪠ã ç§ã®ããŒãžã§ã³ã¯ãæ倧400 MHzã®åšæ³¢æ°ã§3.3 Vã§åäœããŸãïŒ TQFPããã±ãŒãžã«ã¯æ倧32ã®I / Oã©ã€ã³ãããããã®ãã¡2ã€ã®ã©ã€ã³ã¯ã¯ããã¯å ¥åã«äœ¿çšãããŸãã ã©ã€ã³ã¯ãLVCMOS3.3ãLVTTLãããã³PCIã¢ãŒãã§5 Vã«èããŸãã ãã¹ãŠã®çµè«ã¯ããã«ã¢ãããŸãã¯ãã«ããŠã³ã«ãã£ãŠããã«ãããããã空äžã«ã¶ãäžããããšãã§ããŸãã ãŸãããªãŒãã³ãã¬ã€ã³ã¢ãŒãã§äœæ¥ããããšãã§ããŸãã
ã©ãã£ã¹ã®éçºç°å¢
LC4064vãå±ããå°åFPGAã®å ŽåïŒ ispLEVER Classic ã
ãã¡ãŒã ãŠã§ã¢ãã€ã³ã¹ããŒã«ããå¿ èŠãããå ŽåïŒ Diamond Programmer ã
倧èŠæš¡FPGAã®å ŽåïŒ Lattice Diamond
ããã°ã©ã ãæå¹ã«ããã«ã¯ããµã€ã eã§ç»é²ãã MACã¢ãã¬ã¹ãæå®ããã©ã€ã»ã³ã¹ããŒãããŠã³ããŒãããå¿ èŠããããŸãã
ã©ãã£ã¹ãã€ã€ã¢ã³ãç°å¢ã§ãããžã§ã¯ããéçºããæ¹æ³ã®äžè¬çãªã¢ã€ãã¢ãäœæããã«ã¯ã ãã®ãããªãããç解ããããšããå§ãããŸãã
ã©ãã£ã¹ããã©ãã·ã¥ããã«ã¯ïŒ
LPTããã°ã©ããŒã¯ã»ãšãã©éå»ã®ãã®ã§ãã ã¯ããããã°ã©ããŒãçµã¿ç«ãŠãæéãšæ¬²æ±ã¯ãããŸããïŒãããžã§ã¯ããäœããããšãã欲æ±ããããŸãïŒã ã¢ã«ãã©ã®å Žåã®ããã«ãç§ã¯EbayãŸãã¯Aliexpressã®ãµã€ãã§ããã°ã©ããŒã®æ¢è£œã®äžåœã¯ããŒã³ãèŠã€ããŠè³Œå ¥ããããšã«ããŸããã ãã ããã¢ã«ãã©ã®ããã°ã©ããŒãçŽ300ã«ãŒãã«ã®å Žåãã©ãã£ã¹ã®äŸ¡æ Œã¯ãã§ã«çŽ2000ã«ãŒãã«ã§ãã ã¹ããã«ãŒã®ã¿ãç°ãªãäžèŠåäžã®è£œåã®å Žåã ãããã泚ææ·±ãèŠããšã 1300ã«ãŒãã«ã®å®äŸ¡ãªãã®ãèŠã€ããããšãã§ããŸãïŒ ç§ãšå人ã®2人ãåæã«é£ããŠè¡ããŸãã å°çãããšãããããã°ã©ããŒã¯ä»äºãæåŠããŸãã ã 圌ã¯å£²ãæãšéä¿¡ãå§ãã圌ãã¯ãã¹ãŠããã§ãã¯ããŠããããšãä¿èšŒããã ãã®çµæãUSBã³ãã¯ã¿ã«ã¢ãŒã¹ãã¯ãã ä»ãããŠèªåã§ä¿®çããŸããã
ã¢ã«ãã©ã®ããã°ã©ããšæ¯èŒããŠããUSB IDã®ã¿ãç°ãªããã®ã§ã¯ãªãããã¹ãŠãåãã§ããããšã確èªããŸãã
ããã«ããã€ãã®åçïŒ 1ã2ã3 ã ããããæ¬åœã«å€ãã®ã§ãããã°ã©ããŒãããé«äŸ¡ã§ããããšã¯æããã§ãã
ããããæ¥ãã§ãã§ãã¯ããããã«ãLEDãšãã¿ã³ãåããããŒããäœæããŸãã è¶ å°ååè·¯ãã¢ââããã¿ãŒããŒãã«ã¯ãã ä»ãããŸãã
ãžã§ãã¬ãŒã¿ãšããŠã ã¢ã«ãã©ã®Cyclone FPGAãããç°¡åãªãã®ã¯èŠã€ãããŸããã§ãã:) 50 MHzã¯ããã¯ãžã§ãã¬ãŒã¿ã®åšæ³¢æ°ã2 Hzã«åå²ããŠæ»ããŸããã ãã®ä¿¡å·ã¯LC4064vã®ã¯ããã¯å ¥åã«é©çšãããŸãã 圌ã¯æãåçŽãª4ãããã«ãŠã³ã¿ãŒãäœæããããããåãåºããŠLEDã«æ¥ç¶ããŸããã
ç¹æ» -åäœããŸãïŒ
FPGAãæ©èœããããã°ã©ãã³ã°ã«é©ããŠããããšãæããã«ãªã£ãã®ã§ã
解決ãã¹ãåé¡ã¯äœã§ããïŒ
å®éãæèšãäœããšããã¢ã€ãã¢ã¯ããã«ã¯åºãŸããã§ããã ã»ã«ã®æ°ã¯64ã«çãããããå²ãåœãŠå¯èœãªã¿ã¹ã¯ã«ã€ããŠèããããšãã§ããŸãã å³å¯ã«å®çŸ©ãããMKãå©çšå¯èœã§ãããã°ã©ãã³ã°ã®æ¹æ³ãç¥ã£ãŠããæãæãåºãã解決ããåé¡ãããã«åãããããšããŸããã FPGAããã°ã©ãã³ã°ã§ã¯ãåé¡ã解決ããåæçµæã«åºã¥ããŠé©åãªãµã€ãºã®FPGAãéžæãããšããéã®ããšãæ³å®ããŠããŸãã ããããããã§ã¯ãã¹ãŠãäžäžéã«ããŠããµã€ãºãå¶éããŸãã ããã«ãããã¿ã¹ã¯ã®éžæãšãã®å®è£ ã®äž¡æ¹ã§ãç§ãã¡ã¯äžçæžåœåãããšãã§ããŸãã éãããæ¡ä»¶ã§ã®äžçš®ã®æ¥µç«¯ãªããã°ã©ãã³ã°ã
ã©ãããïŒ é»åã·ã³ã»ãµã€ã¶ãŒïŒ ååãªã»ã«ããããŸããïŒMIDIã³ãã³ãã®åä¿¡è ã ãã100ãè¶ ããŸãã ã·ã³ãã«ãªãã®ãå¿ èŠã§ãïŒ ããšãã°ããªãŒãã£ãªI2Sã¹ããªãŒã ã®ãã³ãŒããŒãšæµæåšäžã®DACãä»ããåºå ããã¯éåžžã«å ·äœçã§ã·ã³ãã«ã§ãããããã»ã©å£®èŠ³ã§ã¯ãªãããã§ãã å€ãã®è¡ããããŸã-7ã»ã°ã¡ã³ãã€ã³ãžã±ãŒã¿ãŒãã¶ãäžããããšãã§ããŸãïŒéçã«7x4 = 28ïŒïŒã ãããŠãäœãæãã¹ãã§ããïŒ åšæ³¢æ°ã¡ãŒã¿ãŒïŒãããã¯æ倧400 MHzãŸã§åäœãããããçŽ æŽããããªãã·ã§ã³ïŒãŸãã¯ã¯ããã¯ãäœæã§ããŸãã æèšãéžã¶ããšã«ããŸããã
ã¢ã»ã³ããªéšåãèŠã
æèšã®å Žåã4æ¡ã®7ã»ã°ã¡ã³ãã€ã³ãžã±ãŒã¿ãŒãå¿ èŠã§ãã æåã¯åºã§æ°ããã€ã³ãžã±ãŒã¿ãè³Œå ¥ãããã£ãã®ã§ããããã®åŸããã§ã«çŽ10幎éç®±ã«å ¥ã£ãŠããæèšã€ã³ãžã±ãŒã¿ããã§ã«æã£ãŠããããšãæãåºããŸããã ãããããã ã RadioKotãã©ãŒã©ã ã®åçåšãããããããŸãã ã ç§ã®ã€ã³ãžã±ãŒã¿ããªã³ã«ããåè·¯ã«ã¯ã次ã®ãããªæãããå€èŠ³ããããŸãã
å€ãã³ã³ããŒãã³ãã®ç®±ããªãããFPGAïŒããã³ç§ïŒããããããã¬ãŒã ã¯ãŒã¯ã§ã¯ãäžèŠãããšããããã®ç¹å®ã®ãããã«ããã€ã³ãžã±ãŒã¿ãŒã䜿çšããããšã決å®ãããŸããã å®éããã¹ãŠãéåžžã«ç°¡åã§ããäžããã€ã³ãžã±ãŒã¿ã«å¶åŸ¡é»å§ãå°å ããŸãã ååãšããŠã1æ¬ã®ã¯ã€ã€ã¯2ã€ã®ã»ã°ã¡ã³ãã«çŽæ¥æ¥ç¶ãããŸãã ãããŠã2ã€ã®ã»ã°ã¡ã³ãã®ã©ã¡ããæ©èœãããã¯ãçŸæç¹ã§å ±éã¯ã€ã€ã«æ¥ç¶ãããã¹ã«ãã£ãŠæ±ºãŸããŸãã ãã®ã¹ããŒã ã¯ãäžè¬ã«ãå€å žçãªåç衚瀺ã¹ããŒã ã«å¯Ÿå¿ããŸããã2ã€ã®ã€ã³ãžã±ãŒã¿ãŒããååŸã§ããªããšããéãããããŸãã ãã¹ãŠã®ã€ã³ãžã±ãŒã¿ã®åäœã確èªããããã«ããã¹ãŠã®åºåã«è«çãŠããããããã©ã³ãžã¹ã¿ã«ä¿¡å·ãé çªã«åºåããŸããã
ãã¹ãçµæã«ãããšãååãšããŠãã©ã®ã€ã³ãžã±ãŒã¿ã«ãæ°åã衚瀺ã§ããããšãããããŸããã ãã ãã巊端ã®ã€ã³ãžã±ãŒã¿ãŒã§ã¯ã1ã€ã®ã»ã°ã¡ã³ããæ¬ èœããŠããŸãã ããã«ããããã¹ãŠã®å¯èœãªæ°åã衚瀺ããããšã¯ã§ããŸããããæãéèŠãªã®ã¯æ°åã®ããŒããã§ãã ãã®äºå®ã¯ãã®åçã§ç¢ºèªãããŠããŸã ã ãããã£ãŠãæ°åæéã§ãŒããæ¶æ» ããŸãã
ãã¯ããã¯ãžã§ãã¬ãŒã¿ãŒããå¿ èŠã§ããããã¯32768 Hzã®åšæ³¢æ°ã®ãžã§ãã¬ãŒã¿ãŒã§ãã ãªããã®ãããªé »åºŠã§ããïŒ 15ãããã®ãã€ããªã«ãŠã³ã¿ãŒã䜿çšããŠãã®åšæ³¢æ°ãé©çšãããšãåºåã§1 HzïŒ2 ^ 15 = 32768ïŒã«ãªãããã§ãã ããã¯1ç§ã®ééã§ãã çºé»æ©ã®åšæ³¢æ°ãéžæããéã®ãã1ã€ã®éèŠãªç¹ã«æ³šç®ãããã åšæ³¢æ°ã32768ã§é€ç®ããã«ã¯ã15ãããã®ãã€ããªã«ãŠã³ã¿ãŒãå¿ èŠã§ããããã«ã¯ãFPGAã§å°ãªããšã15ã»ã«ãå¿ èŠã§ãããã«ãªãœãŒã¹ã®ã»ãŒ4åã®1ãå æããŸãã 50 MHzãžã§ãã¬ãŒã¿ãŒã®ã«ãŠã³ã¿ãŒã¯ãæ倧2ç§ã®ééã§åå²ããããã«30ããããå¿ èŠãšããŸãã ãã®ãããªã³ã¹ãã§ã¯ãã¯ããã¯ã®ããžãã¯ã«ååãªã»ã«ããªãå ŽåããããŸãã
ã¯ããã¯ã¯ã©ãŒãã¯ãããŸããããã¢ã«ãã©ãµã€ã¯ãã³ã¯åã³åšæ³¢æ°ãžã§ãã¬ãŒã¿ãšããŠæ©èœãã50 MHzã®åšæ³¢æ°ã32768 Hzã«çµ±åããŸããã
åšæ³¢æ°ãåå²ããã«ã¯ãVerilogã§ã¢ãžã¥ãŒã«ã䜿çšããŸãã ãããæ±ãã®ã¯éåžžã«ç°¡åã§ããclkã§ã¯åæåšæ³¢æ°ãæå®ããs_outããçµæãååŸããŸãã é€ç®ä¿æ°ã¯ãDIVãã©ã¡ãŒã¿ãŒã«ãã£ãŠèšå®ãããŸãã ç§ã®å Žåã50,000,000 Hzã¯å ¥åã¯ããã¯åšæ³¢æ°ã§ã32,768 Hzã¯ååŸããå¿ èŠãããåšæ³¢æ°ã§ãã
frqdivmod #(.DIV(50000000/32768)) divider(.clk(clk50M), .s_out(clk32768));
æŽæ°é€ç®åšã¢ãžã¥ãŒã«ã³ãŒãïŒVerilogïŒ
module frqdivmod(clk, s_out); parameter DIV=2; // calculated parameters parameter WITH = ($clog2(DIV)>0) ? $clog2(DIV) : 1; input wire clk; output wire s_out; reg clk_n; reg [(WITH-1):0] pos_cnt; reg [(WITH-1):0] neg_cnt; wire [(WITH-1):0] div_value = DIV[(WITH-1):0]; initial begin clk_n <= 1'b0; pos_cnt <= {(WITH){1'b0}}; neg_cnt <= {(WITH){1'b0}}; end assign s_out = (DIV==1) ? clk : clk_n; always @ (posedge clk) begin pos_cnt <= (pos_cnt + 1'b1) % div_value; end always @ (negedge clk) begin neg_cnt <= (neg_cnt + 1'b1) % div_value; end always @(clk, pos_cnt, neg_cnt) begin //pos_cnt in sens list addd for resolve warning "variable is read inside the Always Construct but isn't in the Always Construct's Event Control" if ((DIV%2) == 1'b0) begin clk_n <= ( pos_cnt >= (DIV/2)) ? 1'b1 : 1'b0; end else begin clk_n <= (( pos_cnt > (DIV/2)) || ( neg_cnt > (DIV/2))) ? 1'b1 : 1'b0; end end endmodule
ããŒããŠã§ã¢ããžãã¯ãèšå®ãã
ã¯ããã¯ãäœæããæåã®å埩ã¯ãéåæãªã»ããã䜿çšããŠãã€ããªã«ãŠã³ã¿ãŒåè·¯ãäœæããããšã§ãïŒç»åãã¯ãªãã¯ãããšãWebãµã€ãhttp://www.falstad.com/ã§åè·¯ãéããå¿ èŠã«å¿ããŠèª¿æŽã§ããŸãïŒ
ã«ãŠã³ã¿ãŒã®å€ãã10ãïŒb1010ïŒã«éãããšããªã»ããããå¿ èŠããããŸãã åãä¿¡å·ã次ã®æ¡ã«ãŠã³ã¿ã®ã¯ããã¯ãšããŠäœ¿çšãããŸãã
RCãã§ãŒã³ã¯ããªãŒãä¿¡å·ã10ãã®æéãå¢ããããã«äœ¿çšãããŸãã ãã®ä¿¡å·ãçãããå Žåãäžéšã®ããªã¬ãŒã¯ãªã»ãããŸãã¯å€ãå€æŽããæéããªãå ŽåããããŸãã ãã ããFPGAã§éåæãªã»ããã䜿çšãããšãå€ãã®åé¡ãçºçããå¯èœæ§ããããŸãã ä¿¡å·åšæãå¢ããããã«ãã¢ããã°åè·¯ã䜿çšããŠããŸãããããžã¿ã«åè·¯ãéçºããŠããŸãã ãã®ã¢ãããŒããFPGAã«é©çšããå Žåã¯ããã®ä¿¡å·ããããããå€éšåºåã«éããããã«ãã§ãŒã³ãã€ã³ã¹ããŒã«ããŠãããFPGAã®ä»ã®å ¥åã«ãã£ãŒãããã¯ããå¿ èŠããããŸãã
éåæãªã»ããã§ã«ãŠã³ã¿ãŒãå®çŸ©ããVerilogã¢ãžã¥ãŒã«
// counter module cntr #(parameter width=4) (clk, res, out); input wire clk, res; output reg [width-1:0] out; initial out <= {width{1'b0}}; always @(posedge clk or posedge res) begin if (res) begin out <= 0; end else begin out <= out + 1'b1; end end endmodule
å®éšãšããŠãéåæãªã»ããã䜿çšããŠã«ãŠã³ã¿ãŒã®ã¯ããã¯ãäœæããŸããã åæã«ãRCãã§ãŒã³ãåºåããã䜿çšãããããŸããã§ããã ç§ã®ç®æšã¯ãéåæããžãã¯ã䜿çšãã䟡å€ãããã®ãââããããšããç¶ããŠããã®ããã調ã¹ãããšã§ããã ç¹å®ã®æ®µéãŸã§ãæèšã¯å®æçã«æéãã«ãŠã³ãããŸãã
ãããããã®ç¬éãç§ã¯æèšã«ç§ã®ç¹æ» ãå ããããšã«æ±ºãããšãããã¹ãŠãçªç¶å£ããŸããã
FPGAã§éçºããå Žåã¯ãåæããžãã¯ã䜿çšããããšã匷ããå§ãããŸãã ã¯ããã¯ãšã«ãŠã³ã¿ã®å Žåãã«ãŠã³ã¿ã®çŸåšã®å€ãã¬ãžã¹ã¿ã«ä¿åããå¿ èŠããããçµã¿åããåè·¯ã«ããã¬ãžã¹ã¿ã®æ¬¡ã®å€ãèšç®ããå¿ èŠããããŸãã 次ã®å€ã¯ã次ã®æž¬å®ã®åã«æ確ã«èšç®ãããŸãïŒããããããšãæã¿ãŸãïŒããã¯ããã¯ãã«ã¹ã®ãšããžã«æ²¿ã£ãŠã¬ãžã¹ã¿ã«ããŒããããŸãã ã€ãŸããæŸé»ã®ãéããããæããããšã¯ãããŸããã ã¬ãžã¹ã¿ã®çŸåšã®å€ã«åºã¥ããŠã次ã®ã¡ãžã£ãŒã§åžžã«äžæã«å€ã決å®ããŸãã
reg [3:0] s;// 0..9 - 4bit -- // wire s_cy = (s == 4'd9); // : wire [3:0] next_s = (s_cy) ? 4'd0 : (s + 1'b1); // +1, 0, 9 // always @(posedge clk1Hz) begin s <= next_s; end
7ã»ã°ã¡ã³ãã€ã³ãžã±ãŒã¿ãŒã§ã¬ãžã¹ã¿ã®å€ã衚瀺ããã«ã¯ããã€ããªãã7ã»ã°ã¡ã³ãã³ãŒããžã®ã³ã³ããŒã¿ãŒã¢ãžã¥ãŒã«ãå¿ èŠã§ãã
Verilogã¢ãžã¥ãŒã«bcd2seg0_9
//bin to 7seg module bcd2seg0_9(sin, sout); input wire [3:0] sin; output wire [6:0] sout; reg [6:0] SEG_buf; always @ (sin) begin case(sin) 4'h0: SEG_buf <= 7'b0111111; 4'h1: SEG_buf <= 7'b0000110; 4'h2: SEG_buf <= 7'b1011011; 4'h3: SEG_buf <= 7'b1001111; 4'h4: SEG_buf <= 7'b1100110; 4'h5: SEG_buf <= 7'b1101101; 4'h6: SEG_buf <= 7'b1111101; 4'h7: SEG_buf <= 7'b0000111; 4'h8: SEG_buf <= 7'b1111111; 4'h9: SEG_buf <= 7'b1101111; default: SEG_buf <= 7'b0000000; endcase end assign sout = SEG_buf; endmodule
ãªãœãŒã¹ãç¯çŽããããã«ã0ãã9ãŸã§ã®æ°åã®ãªãã·ã§ã³ã®ã¿ã説æããŸããå®éšã®ããã«ã代æ¿ã³ã³ããŒã¿ãŒã¢ãžã¥ãŒã«ãè©ŠããŸãã
Verilogã¢ãžã¥ãŒã«bcd2seg0_9ïŒ2ïŒ
//bin to 7seg module bcd2seg(sin, sout); input wire [3:0] sin; output wire [6:0] sout; assign sout = (sin==4'h0) ? 7'b0111111 : (sin==4'h1) ? 7'b0000110 : (sin==4'h2) ? 7'b1011011 : (sin==4'h3) ? 7'b1001111 : (sin==4'h4) ? 7'b1100110 : (sin==4'h5) ? 7'b1101101 : (sin==4'h6) ? 7'b1111101 : (sin==4'h7) ? 7'b0000111 : (sin==4'h8) ? 7'b1111111 : (sin==4'h9) ? 7'b1101111 : 7'b0000000; endmodule
ããããæ¶è²»ããããªãœãŒã¹ã®éã¯å€ãããŸããã è³¢ãã·ã³ã»ãµã€ã¶ãŒãåã¶ã
次ã«ãç§ïŒåäœã10ïŒãåïŒåäœã10ïŒãæéïŒåäœã10ïŒã®ã¬ãžã¹ã¿ãäœæããŸãã ããããã«ã€ããŠã次ã®å€ã®èšç®ãèšå®ããŸãã ãããã1ç§ããšã®ã€ã³ãã«ã¹ã§ç§ã®å€ãå€æŽããŸãããæ°åç§ã®å€ãå€æŽããŸã-ãŠãããã®ãªãŒããŒãããŒã®ã¿ã§ãã ãããã£ãŠãååäœã¯ãæ°åããã³ç§åäœããªãŒããŒãããŒããå Žåã«ã®ã¿å€æŽãããŸãã ãªã©ãªã©ã
åæã«ãåæã§ã¯ãã¹ãŠãæ£åžžã§ããããšã瀺ãããŸããããããã€ã¹ã®ã»ã«ã¯ãã§ã«æ¬ èœããŠããŸãã ãã£ãš ç¶æ³ãä¿®æ£ããããã«ã2çªç®ã®ã¬ãžã¹ã¿ãåçŽåããããšã決å®ãããŸããã ããã§ã衚瀺ãããªãã®ã§ã2ã€ã®10é²ã«ãŠã³ã¿ã0ãã59ã®1ã€ã®ãã€ããªã«å€æŽããŸããå°ãå ã«é²ããŠããã1ã€äœæããŸããããã¯ããã¯ã¯ã©ãŒãåšæ³¢æ°ã®å ±éååšåšã®ã«ãŠã³ã¿ãæžãããŸããã ãããã£ãŠãã«ãŠã³ãã¯0ãã119ã«ãªããŸãããåšæ³¢æ°ã¯2 Hzã§ãïŒä»¥äžã®ãæéã®èšå®ã«é¢ããéšåãåç §ïŒã
//clk - general clock 32768 reg [13:0] clk_div; initial clk_div <= 14'd0; //?? Lattice always @(posedge clk) clk_div <= clk_div + 1'b1; // , , reg [6:0] sec;// 0..119 reg [3:0] m ;// 0..9 reg [3:0] mm ;// 0..5 reg [3:0] h ;// 0..9 reg [3:0] hh ;// 0..2 // wire sec_cy = (sec == 7'd119); wire [6:0] next_sec = (sec_cy) ? 7'd0 : (sec + 1'b1); wire m_cy = (m == 4'd9);// && sec_cy; wire [3:0] next_m = (m_cy) ? 4'd0 : (m + 1'b1);//(m_cy) ? 4'd0 : (m + ss_cy); wire mm_cy = ((mm == 3'd5) &&(m == 4'd9)); wire [2:0] next_mm = (mm_cy) ? 3'd0 : (mm + 1'b1); wire h_cy = (h == 4'd9)||((hh == 4'd2) && (h == 4'd3)); wire [3:0] next_h = (h_cy) ? 4'd0 : (h + 1'b1); wire hh_cy = ((hh == 2'd2) && (h == 4'd3)); wire [1:0] next_hh = (hh_cy) ? 2'd0 : (hh + 1'b1); // wire timer_clk = clk_div[13]; always @(posedge timer_clk) begin sec <= next_sec; m <= ( sec_cy) ? next_m : m; mm <= ( m_cy&&sec_cy) ? next_mm : mm; h <= ( mm_cy&&m_cy&&sec_cy) ? next_h : h; hh <= (h_cy&mm_cy&&m_cy&&sec_cy) ? next_hh : hh; end
7ã»ã°ã¡ã³ãææšã«é¢ããçµè«
åã¬ãžã¹ã¿HHïŒMM 7ã»ã°ã¡ã³ãã€ã³ãžã±ãŒã¿ãŒã«è¡šç€ºããŸãã ãããããã®åã«ã7ã»ã°ã¡ã³ãã³ãŒãã«å€æããŸãã
// wire [6:0] s_m; wire [6:0] s_mm; wire [6:0] s_h; wire [6:0] s_hh; // bcd2seg0_9 sseg_m( .sin(m), .sout(s_m)); bcd2seg0_5 sseg_mm(.sin(mm), .sout(s_mm)); bcd2seg0_9 sseg_h( .sin(h), .sout(s_h)); bcd2seg0_2 sseg_hh(.sin(hh), .sout(s_hh));
ããããåçãªå åããããŸãã ããã«ãåºåæã«ã¯ãåã ã®7ã»ã°ã¡ã³ããããã¯ã§ã¯ãªããã€ã³ãžã±ãŒã¿ãŒã®åã ã®èŠçŽ ãåãæ¿ããããŸãã ãããã£ãŠãåã€ã³ãžã±ãŒã¿ãŒèŠçŽ ã®ã¬ãã«ã«è¡ããŸãããã
// wire a1,b1,c1,d1,e1,f1,g1; wire a2,b2,c2,d2,e2,f2,g2; wire a3,b3,c3,d3,e3,f3,g3; wire a4,b4,c4,d4,e4,f4,g4; // assign {g4, f4, e4, d4, c4, b4, a4} = s_m; assign {g3, f3, e3, d3, c3, b3, a3} = s_mm; assign {g2, f2, e2, d2, c2, b2, a2} = s_h; assign {g1, f1, e1, d1, c1, b1, a1} = s_hh;
ããã«ãã€ã³ãžã±ãŒã¿ãŒãã€ã¢ã°ã©ã ã«åºã¥ããŠããã€ãã¹ã«æ²¿ã£ãŠ2æ¬ã®ç·ãããããšãç解ããŠããŸãã ããããé çªã«åãæ¿ããŸãã
wire led_line1 = (clk_div[7]); //8- 32768 wire led_line2 = (~led_gnd1);// 256
çŸåšã¢ã¯ãã£ããªè¡ã«å¿ããŠãã»ã°ã¡ã³ãã®çµåãããè¡ã«å¯Ÿå¿ããå€ãå²ãåœãŠãŸãã
wire h_show = !(hh==0); // assign led6 = (led_line1&&(b1&&h_show)) || (led_line2&&(b1&&h_show)); // b1 assign led7 = (led_line1&&(a1&&h_show)) || (led_line2&&(g1&&h_show)); // a1/g1 assign led8 = (led_line1&&(d1&&h_show)) || (led_line2&&(e1&&h_show)); // d1/e1 assign led9 = (led_line1&&e2) || (led_line2&&(c1&&h_show)); // e2/c1 assign led10 = (led_line1&&g2) || (led_line2&&b2); // g2/b2 assign led12 = (led_line1&&d2) || (led_line2&&c2); // d2/c2 assign led13 = (led_line1&&f2) || (led_line2&&a2); // f2/a2 assign led15 = (led_line1&&a3) || (led_line2&&f3); // a3/f3 assign led16 = (led_line1&&b3) || (led_line2&&g3); // b3/g3 assign led17 = (led_line1&&c3) || (led_line2&&d3); // c3/d3 assign led18 = (led_line1&&e4) || ((led_line2)&&e3); // e3/e4 !! assign led19 = (led_line1&&g4) || ((led_line2)&&b4); // g4/b4 assign led20 = (led_line1&&d4) || ((led_line2)&&c4); // d4/c4 assign led21 = (led_line1&&f4) || ((led_line2)&&a4); // f4/a4
ãªãœãŒã¹ã®éäº
ãããŠãåã³ååãªãªãœãŒã¹ããªãããšãããããŸããïŒ ãªãœãŒã¹ã奪ãåãéçšã§ã次ã®æé ãå®è¡ãããŸããã
bcdã®ãšã³ã³ãŒããŒã7ã»ã°ã¡ã³ãã³ãŒãã«åç·šéããŸãã éåžžã®ãšã³ã³ãŒããŒã¯ã16é²åœ¢åŒã§0ã15ã®æ°å€ãå€æããŸãã ã¯ããã¯ã¯è¡šç€ºã«10é²æ³ã䜿çšããããããšã³ã³ãŒããŒã«ã¯0ã9ã®æ°åã®ã¿ãæ®ã£ãŠããŸãããã€ãŸããå ¥åã¯4ãããã§ãåºåã¯7ãããã¯ãŒãã®10çš®é¡ã§ãã ãã ããæ°ååïŒ0ã5ïŒã®éã¯ã3ãããã®ãšã³ã³ãŒãã§ååã§ãã ããã¯6ã€ã®ãªãã·ã§ã³ã§ãã åæ§ã®ç¶æ³ãæ°åæéååšããŸãã éåžžã0ã2ã®3æ¡ã®ã¿ããããŸããããã¯ããšã³ã³ãŒããŒå ¥åã«å¯ŸããŠ2ãããã§ãåºåãªãã·ã§ã³ã¯3ã€ã®ã¿ã§ãã ããã¯ãã¹ãŠãããããåæã®è€éãã軜æžããã§ãããã ãããŠãããèµ·ãã£ãïŒ äœ¿çšãããã»ã«ã®æ°ã¯ã63ãã59ã«æžå°ããŸããã
ã¬ãžã¹ã¿ã®å®¹éãæ°ååããã³æ°æéåæžããŸããã ããã«ããããããæ°ã ãã»ã«ã®æ°ãæžããå ç®åè·¯ãç°¡çŽ åãããŸãã
reg [6:0] sec;// 0..119 - 7bit reg [3:0] m ;// 0..9 - 4bit reg [2:0] mm ;// 0..5 - 3bit reg [3:0] h ;// 0..9 - 4bit reg [1:0] hh ;// 0..2 - 2bit
åèšãããšãæé©åã®éå§æç¹ã§ã64ã»ã«äž63ã»ã«ãå æãããŠãããããå¯èœãªè¿œå æ©èœã ãã§ãªããåºæ¬æ©èœïŒæéã®èšå®ãªã©ïŒãå®è£ ããå¯èœæ§ãçåèŠãããŸããã çŸåšã56åã®ãã¯ãã»ã«ãå æããã8åãç¡æã«ãªã£ãŠããŸãã å²åã¯98ïŒ ã§ãããã87ïŒ ã«ãªããŸããã ãã®ãããªå°ããªããªã¥ãŒã ã®å Žåãããã¯éåžžã«è¯å¥œã§ãïŒçŽ10ïŒ ïŒ
æéèšå®
ãªãœãŒã¹ãç°¡åã«ãªã£ãã®ã§ãæéã®èšå®ã«åãããããŸãããã ãæéãããåãããç§ãã®3ã€ã®ãã¿ã³ãäœæããããšã«ããŸããã ãæèšããã¿ã³ãæŒãç¶ãããšãå€ãå¢å ããŸãã åãæ¡ä»¶ãåãã¿ã³ã«ãé©çšãããŸãã ããã¯ç°¡åã§ãããã¿ã³ãæŒãããå ŽåïŒäœäœããªãŒããŒãããŒãããšãã ãã§ãªãïŒãåã¡ãžã£ãŒã§ã¬ãžã¹ã¿ã«æ°ããå€ãæžã蟌ãããšãã§ããŸãã
ãç§ããã¿ã³ãæŒãããšã¯å¥ã®ããžãã¯ã§ããç§ã«ãŠã³ã¿ãŒããªã»ããããç§ã«ãŠã³ããåæ¢ããå¿ èŠããããŸãã
æéèšå®ãããå¿«é©ã«ããããã«ãå€ã®å¢å é床ãäžããå¿ èŠããããŸããããã®ããã«ã¯ãæçµã¯ããã¯ã®åšæ³¢æ°ã2 Hzã§ã¯ãªã2 Hzã«éžæããå¿ èŠããããŸãïŒããã«ã€ããŠã¯äžã§æžããŸããïŒã ãŸããååšåšã§1ã€ã®ã»ã«ãç¯çŽããã1ãããå°ãªããªããŸããã
input wire btn_HH, btn_MM, btn_SS; // , , wire timer_clk = clk_div[13]; always @(posedge timer_clk) begin sec <= (btn_SS) ? 7'd0 : next_sec; //reset seconds m <= ( sec_cy)||(btn_MM) ? next_m : m; mm <= ( m_cy&&sec_cy)||(btn_MM&&m_cy) ? next_mm : mm; h <= ( mm_cy&&m_cy&&sec_cy)||(btn_HH) ? next_h : h; hh <= (h_cy&mm_cy&&m_cy&&sec_cy)||(btn_HH&&h_cy) ? next_hh : hh; end
ã芧ã®ãšããã1ç§éã«2åããªãŒããŒãããŒä¿¡å·ãŸãã¯ãã¿ã³ãæŒããµã€ã³ã確èªããŸãã ã©ã¡ãã®å ŽåããæéãŸãã¯åãå¢å ããŸãã ãç§ããã¿ã³ãæŒãããŠããéãç§ã®å€ã¯ãŒãã«èšå®ãããŸãã
2çªç®ã®ã€ã³ãžã±ãŒã¿
2çªç®ã®ã€ã³ãžã±ãŒã¿ãŒã«ã€ããŠã¯ãååšåš32768ã®ã¬ãžã¹ã¿ãŒããã®ãããã¯ãã¯ãé©åã§ã¯ãããŸããæå°åšæ³¢æ°ã¯2Hzã§ããã1ç§éã«1åç¹æ» ããå¿ èŠãããããã§ãã ãããã1ç§ã«2åãç§ã®ãã€ããªã«ãŠã³ã¿ãŒãå¢ãããŸãã ãããã£ãŠããã®ã«ãŠã³ã¿ãŒãããŒãããããååŸããŸãã
assign led_second_tick = sec[0];
ãšãã«ã®ãŒæ¶è²»ãšçãšã
æ©èœã®è¿œå ãèš±å¯ãããã»ã«ã®ãªãªãŒã¹ã 1ã€ã®ã¢ã€ãã¢ã¯ãããã¯ã¢ããããããªãŒã§é»æºãäœãããšã§ãã äž»é»æºãããå Žåãæèšã¯ãã«ã¢ãŒãã§åäœããããã¯ã¢ããé»æºã«åãæ¿ãããšããšã³ãããŒã¢ãŒãã«ãªããŸãããã£ã¹ãã¬ã€ããªãã«ããŠãæéã®ã«ãŠã³ãã®ã¿ãåŠçããŸãã
ãã®æ©èœã®å®çŸå¯èœæ§ãå€æããã«ã¯ãéåžžã¢ãŒãã§ã®é»æµãšãçãšãã¢ãŒãã§ããã€ã¹ãæ¶è²»ããé»æµãå€æããå¿ èŠããããŸãã ãããããã»ã°ã¡ã³ããããçŽ10 mAã®é»æµã§ãåæã«åäœããã»ã°ã¡ã³ãã12å以äžã®å Žåã120 mAã®è¡šç€ºããã®ã¿ååŸã§ãããšæšå®ã§ããŸãã ããã«ãFPGAèªäœããšãã«ã®ãŒãæ¶è²»ããŸãã ããã¥ã¡ã³ãã«ãããš-ããã¯çŽ10 mAã§ããå¿ èŠããããŸãã
枬å®çµæã¯ãããã€ã¹å šäœãå šäœã§125 mAãæ¶è²»ããããšã瀺ããŠããŸãã ããã¯èšç®ã«è¿ãã§ãã ããžãã¯ãšå¥ã®å ¥åä¿¡å·ã«æ¡ä»¶ãè¿œå ããŸãã ããã¯ãããã€ã¹ããšã³ãããŒã¢ãŒãã«ããä¿¡å·ã§ãã ãããã¯ãŒã¯ãããšãã«ã®ãŒãåãåãåè·¯ã®éšåãããé»æºããå¶åŸ¡ä¿¡å·ãååŸããŸãã ãŠãŒã¶ãŒãããã€ã¹ããšã³ãããŒã¢ãŒãã§åäœããŠããããšã確èªããããã«ãç¹æ» ãã2çªç®ã®LEDãè¿œå ããŸãã åšæ³¢æ°ã¯åãã«ãªããŸãããéåžžã¢ãŒãã®ããã«å å¡«çã¯50ïŒ ã§ã¯ãããŸããããéåžžã«çããã©ãã·ã¥ãè¡ããŸãã ãããè¡ãã«ã¯ãã«ãŠã³ã¿ååšåšåšæ³¢æ°ãããããã®äžéšãåããŸãã ãã®ããžãã¯ãå®è£ ããã®ã«å¿ èŠãªã»ã«ã¯1ã€ã ãã§ãã
input wire btn_SAFE; // wire SAFE_MODE = ~btn_SAFE; // 1 , , // wire led_line1 = (clk_div[7])&&(SAFE_MODE==0); wire led_line2 = (~led_gnd1) &&(SAFE_MODE==0); // assign led_second_tick = (sec[0]&&(!SAFE_MODE))||(sec[0]&&(clk_div[13:6]==10'd0)&&(SAFE_MODE));
çé»åã¢ãŒãã§ã®é»æµã¯18.5 mAã§ããã ååãšããŠãããã¯ããã»ã©å€ããããŸããã ãã ãã補é å ã®Webãµã€ãã§é©çšãããFPGAãèŠã€ãã£ãå Žåããäœé»åã®SuperFASTâ¢CPLDãœãªã¥ãŒã·ã§ã³ãæäŸããã¢ãŒããã¯ãã£ããšããŠåé¡ãããŸãã è¶ é«é-æ倧400 MHzã§ãã ã¹ããŒãã®ããã«ãã®ãããªé»æµãæµããŠããã®ã§ã¯ãªãããšçã£ãŠããŸãã ããããã©ã€ã³ãããã«ã¯äœéã§çµæžçãªãªãã·ã§ã³ããããŸãïŒispMACH 4064ZEãåäœé»æºé»æµVcc = 1.8Vãé»æµ80ãã€ã¯ãã¢ã³ã㢠ã
ãžã§ãã¬ãŒã¿ãŒãå®æããã
ãžã§ãã¬ãŒã¿ãŒãäœæããããã«ãæåã«FPGAããžãã¯ãšã¬ã¡ã³ãã䜿çšããããšã«ããŸããã éåžžã«ç¬åµçã§çµæžçã§ãã ãã ãããäœããããŸããããªãã£ããããããã®ãªãã·ã§ã³ã¯æ©èœããŸããã§ããã ãããŠãCycloneã§ããããããŠéãããã¡ãŒãäœæããå Žåã§ããã ãã¡ããããã£ãŒãããã¯ãã©ã¡ãŒã¿ã䜿çšããŠããã®ãããªã¹ããŒã ãæ©èœãããããšãã§ãããšæããŸãã äžè¬ã«ãå€éšãžã§ãã¬ãŒã¿ãŒãäœæããå¿ èŠããããŸãã ç§ã¯ã¹ããŒã ãæ¢ããŠããŸããã éžæãããã©ã³ãžã¹ã¿åè·¯ã¯æ©èœããŸããããåä¿¡ä¿¡å·ã®ãã©ã¡ãŒã¿ãŒã«ããããžã§ãã¬ãŒã¿ãŒãšããŠäœ¿çšã§ããŸããã§ããã ãã®çµæãå®èšŒæžã¿ã®ãžã§ãã¬ãŒã¿ãŒåè·¯ãTTLãããäžã«çµã¿ç«ãŠãããšã«ããŸããã ããããKR1533LA3ã§ã¯ã ãã®åè·¯ã¯æ©èœããŸããã§ããã ãã®çµæããã®ã¹ããŒã ã«åºã¥ããŠãžã§ãã¬ãŒã¿ãŒãèµ·åãããŸããã
1ã€ã®åé¡ãæ®ã£ãŠããŸãããKR1533LA3ãããã¯5V +-10ïŒ ãã€ãŸã4.5ã5.5ã®é»å§ã§åäœããFPGAã¯3.3ãã«ãã§åäœããŸãã ãã ãããããã®åäœã¯æ¬è³ªçã«ã¢ããã°ã¢ãŒãã§çºçããŸãã ç§ã¯ãªã¹ã¯ãåãã3.3ãã«ãããèµ·åããŸãã-ããã¯åäœããŸãïŒ æèšã䌌ãããã«èšå®ããŸãã
çºé»æ©
ãã®ãããªã¹ããŒã ã®åæããããã€ã¯ãåè·¯ã®ã¿ã€ãã«ã¯äœããã®æå³ããããšããèãã«è³ããŸããã ãã®ãããªãã¹ãŠã®åè·¯ã§ã¯ãCMOSã䜿çšãããç§ã®å Žåã¯TTLãããããããŸããã ãã®ä»®èª¬ããã¹ãããããã«ãç§ã¯åºã«è¡ãã561ã·ãªãŒãºã®ããããããã€ãè³Œå ¥ããŸããã ãã®äžã«ã¯K561LA9ãããããããŸããã ææžã®ç 究ã«ããããã®è¶ å°ååè·¯ã¯3..18ãã«ãã®ç¯å²ã®é»å§ã§åäœã§ããããšã瀺ãããŸãããããã«ãããé»æºã®æ£ç¢ºæ§ã®åé¡ã解æ¶ãããŸãã åè·¯ã¯ããã«èµ·åããŸãããã32768 Hzã§ã¯ãªããããçšåºŠã®é«èª¿æ³¢ã§èµ·åããŸããã 100Kã®æµæã300Kã«å¢ããå¿ èŠããããŸããã æèšã䌌ãããã«èšå®ããŸãã 2æ¥ã§ãæèšã¯çŽ30ç§é²ã¿ãŸããã ãããå°ãããããŸãããããã§ã«6æéã§+3åãããåªããŠããŸãã ããã§ãçºé»æ©åè·¯å ã®ã³ã³ãã³ãµãããã¯ã¢ããããŠãããæ£ç¢ºãªã¹ãããŒã¯ãããå€ãèšçœ®ã§ããŸãã ãããŠããã®ãããªåšæ³¢æ°åå·®ã枬å®ã§ããåšæ³¢æ°ã¡ãŒã¿ãŒãæ§ç¯ããæ¹æ³ãèããŠãã ããã ããããªããšã粟床ã®èª¿æŽãé ããå ŽåããããŸãã Cyclone FPGAãš50 MHzãžã§ãã¬ãŒã¿ãŒã䜿çšããŠã枬å®æé1ã10ç§ã®åšæ³¢æ°ã¡ãŒã¿ãŒãã¹ã±ããããSignalTapã䜿çšããŠããŒã¿ãèªã¿åããŸããã çºé»æ©ã«é»æºã³ã³ãã³ãµãå ¥ããã³ã³ãã³ãµãšã¹ãããŒã¯åšæ³¢æ°çšã®å調ã³ã³ãã³ãµãéžã³ãŸããã åšæ³¢æ°ã32768ã«èšå®ãã枬å®ã®ç²ŸåºŠããã©ã¹ãŸãã¯ãã€ãã¹ããŸããã ç®ã«èŠããã³ãŒã¹ã®æ¥äžãéžè±ã¯æ€åºãããŸããã§ããã ããããã¹ãŠãžã§ãã¬ãŒã¿ãŒã§ãã
MRB 1178ãèªããšãã¯ã©ãŒãæèšã䜿çšãããšã1ãæãããæ倧2ç§ã®ç²ŸåºŠãéæã§ããããšãããããŸããã ãã®ãããªç²ŸåºŠã®å€ã¯ãåçŽãªæèšã«ã¯ååã ãšæããŸãã
é»æº
èšç®ãšæž¬å®ã«ãããšãããã€ã¹ã®æ¶è²»é»åã¯120 mAã§ãã å ã ã220ãã«ãã®äž»é»æºããããã€ã¹ã«é»åãäŸçµŠããããšãèšç»ãããŠããŸããã ãããã£ãŠãã³ã³ããŒã¿220ããã®é«ãå€ã®å¹ç-> 3.3ãã«ã-ã¯å¿ èŠãããŸããã§ããã ãã®ãããªé»æµã§ã¯ãç·åœ¢å®å®åšã¯æ¶è²»éã®å¢å ã«ã€ãªãããŸãããåæã«ããã®ã·ã³ãã«ãã«ããåªããä¿¡é Œæ§ãæäŸããŸãã äžè¬çã«ããšãã«ã®ãŒãç¯çŽããé©åãªã³ã³ããŒãã³ããããã¯ã¢ããããããšããå¿ èŠã§ããããšã«åæããŸãã ããããç§ãã¡ã«ã¯ã·ã³ãã«ãªæèšããããç§ã¯é»æ°ã®éå°ãªæ¶è²»ã«å¯ŸããŠæ¯æãæºåãã§ããŠããŸãã
å®å®è£ 眮ã®åºåãããããã¯ãŒã¯ã«é»å§ããããšããä¿¡å·ãååŸããŸãã ååšããªãå Žåã¯ãã€ã³ãžã±ãŒã¿ããªãã«ããŸãïŒ
æ¬äœ
ã±ãŒã¹ã¯å°ããªãã®ãéžã³ãŸããã ç§ã¯ãã¹ãŠãããã«åãããããšããå¿ èŠããããŸããã ã©ãããåãä»ããããã®ããã€ãã®ã©ãã¯ã¯åãŸãªããã°ãªããªãã£ãã é»æºã¯å€éšã®ãã®ã䜿çšããå¿ èŠããããŸãã æéãåããªã»ããç§ãèšå®ãããã¿ã³ãã±ãŒã¹ã«è¡šç€ºãããŸãã
åéãããã¬ãŒãã®ãªã¹ã
- é©åãªæ é€ã æåã¯FPGAãããã°ã©ã ãããŸããããLEDãç¹æ» ãããŠããŒããæ¥ç¶ãããšãåé¡ãå§ãŸããŸããã ããã°ã©ããŒã¯ããããããèŠããããšãšæ±ºå®ããããšããããŸããã ãã®åé¡ã¯ããã€ã¯ãåè·¯ã®åé»åç·ã«ãã£ã«ã¿ãŒã³ã³ãã³ãµãåãä»ããããšã§è§£æ±ºããŸããã
- éåæããžãã¯ã éåæãªã»ãããåããã«ãŠã³ã¿ã¯ãåå¥ã®ã«ãŠã³ã¿ã®ã¯ããã¯ã®å žåçãªãœãªã¥ãŒã·ã§ã³ã§ãã FPGAã§ã®éåæããžãã¯ã®äœ¿çšã¯ãäœæ¥ãäºæž¬äžèœã§ããããã匷ãæšå¥šãããŸããã ä¿¡é Œã§ããFPGAãœãªã¥ãŒã·ã§ã³ã¯åæããžãã¯ã§ãã
- FPGAãã¡ãŒã ãŠã§ã¢ã®çŽåŸã®èªåãªã»ããã®æ¬ åŠã ããã°ã©ãã³ã°åŸããã€ã¯ããµãŒãããã¯ãã°ããåäœãåæ¢ãããã®åŸåã³åäœãéå§ããŸãã ãã ãããã®å Žåãæããã«ãããªã¬ãŒã®çŸåšã®å€ã¯ãªã»ãããããŸããã åæã«ãæèšã¯ç»é¢äžã«ãã³ã»ã³ã¹ã衚瀺ãå§ããŸãã å Žåã«ãã£ãŠã¯ããã¹ãŠãããŸãããããã«èŠãããããããŸããã ããã¯èª€è§£ãæãå¯èœæ§ããããäœããããã°ã©ã ãããŠããªãããã«æãããŸãã ãããããã¹ãŠã®ã¬ãžã¹ã¿ããªã»ãããããããã«ããããã®é»æºããªãã«ããŠãããªã³ã«ããã ãã§ãã ãã®FPGAãããã®JTAGå ¥åã«ã¯ãªã»ããå ¥åããªããããããã°ã©ãã³ã°åŸã«èªåãªã»ããã¯çºçããŸããã
- ããªã»ããã¬ãžã¹ã¿å€ã®æ¬ åŠã ã©ãã£ã¹ããããããã°ã©ãã³ã°ããå Žåãã¬ãžã¹ã¿ã®åææ§é ã¯åæãããªãããšã«æ³šæããŠãã ããã , , initial . . , N, . , , ( ) â .
- . , , , , . â . . . , . , .. 400 . â 315. , - . pull-up, ? , . . pull-down . "" . . ⊠ãã©ãã¯ã¹TT !!!
- æèšã®ç²ŸåºŠãã¯ããã¯ã¯ãªãŒããžã§ãã¬ãŒã¿ãŒ+ TTLããã-1æ¥3åéå®å®ããŠåäœããŸããCMOSãããäžã§ããæ£ç¢ºãªãžã§ãã¬ãŒã¿ãŒãäœæãããŸãããäžè¬ã«ãæ°Žæ¶çºæ¯åšã®èšèšã®åé¡ã¯éåžžã«åºç¯å²ã§ãããèšäºã®ç¯å²ãè¶ ããŠããŸãã[6ã7ã8]ãåç §
çµè«
è¡ãããäœæ¥ã®çµæãç§ã¯æ¬¡ã®è¯å®çãªçµè«ã«éããŸããã
- ã©ãã£ã¹FPGAãšãã®éçºç°å¢ã¯å®å šã«æ©èœããŸãã
- Verilogãªã©ã®æ±çšHDLèšèªã䜿çšãããšãFPGAã¡ãŒã«ãŒãåé¡ãªãå€æŽã§ããŸãã
- ãããžã§ã¯ãã®éçºäžã«çºçããåé¡ã®ã»ãšãã©ã¯ããããžã§ã¯ãã®ã³ã¢ãFPGAã§ãããšããäºå®ãšã¯é¢ä¿ãããŸããã§ããïŒã¬ãžã¹ã¿ã®ãã©ãã·ã¥ãšåæååŸã®ãªã»ããã®å Žåãé€ãïŒã
- , 64...500 , , , , ;
- : 64 . 32 . , . 64 . RTC â DS1302, DS1307, DS3231, . , , GPS LCD , ~240 [9].
ç§ã¯èªåã§æ°ããFPGAãç 究ããå€ãã®æ°ããããšãåŠã³ãå¯ä»ããããã€ã¯ãåè·¯ãLEDã¹ã¯ãªãŒã³ãåãä»ããå¯ä»çšã®æèšãçµã¿ç«ãŠãŸãããé¢çœããããžã§ã¯ããšè¯ãæ°åããç¥ãããŸãïŒ
GitHubãããžã§ã¯ãã®ãœãŒã¹ã³ãŒãïŒhttps :
//github.com/UA3MQJ/fpga_simple_clock
åç §è³æ
- Quartus IIãšå°ããªVerilogã䜿çšããFPGAã¯ããã¯
- FPGAã¯ããã¯
- ã©ãã£ã¹è£œå
- we.easyelectronics.ru-TT flux-gelïŒæ³šæãã¯ãœïŒïŒ
- 1178ãMOSéç©åè·¯ã®é»åæèšãåç § æåœã-M .: Radio and Communicationsã1993.-48 p .: Ill .-ïŒMass Radio Library; Issue 1178ïŒã
- æ°Žæ¶çºæ¯åšã®åšæ³¢æ°å®å®åã®æ©èœ
- æ°Žæ¶çºæ¯åš
- æ°Žæ¶æ¯åå
- èŠãŠãGPS + LCD WH0802
- æããªFPGAãŠã©ãã