推荐星级:
  • 1
  • 2
  • 3
  • 4
  • 5

Cyclone2 FPGA读写FLASH SST39VF1601 实验Verilog逻辑源码Quar

更新时间:2021-09-02 11:23:47 大小:2M 上传用户:xzxbybd查看TA发布的资源 标签:fpgaflash 下载积分:9分 评价赚积分 (如何评价?) 打赏 收藏 评论(0) 举报

资料介绍

Cyclone2 FPGA读写FLASH SST39VF1601 实验Verilog逻辑源码Quartus工程文件

module FLASH_TEST ( 

//input  

input               sys_clk            ,    //system clock;

input               sys_rst_n          ,    //system reset, low is active;


//output               


inout       [15:0]  FLASH_DQ            ,  

       

output reg  [20:0]  FLASH_ADDR          ,         


output reg          FLASH_CE            ,         

output reg          FLASH_OE            ,         

output reg          FLASH_WE            ,         

     

output reg          FLASH_RST           ,    

     

output reg  [ 7:0]  LED              


                   );


//Reg define 

reg    [3:0]             div_cnt             ;

reg                      flash_clk           ;


reg    [31:0]            wait_cnt            ;



reg    [5:0]             ctrl_cnt            ;


reg    [15:0]            flash_data_lck      ;


reg    [15:0]            flash_din          ;


//Wire define 



//************************************************************************************

//**                              Main Program    

//**  

//************************************************************************************


// counter used for div osc clk to flash ctrl clk  50M/16 , one flash ctrl clk cycle is 330ns

always @(posedge sys_clk or negedge sys_rst_n) begin 

    if (sys_rst_n ==1'b0) 

        div_cnt <= 4'b0;

    else  

        div_cnt <= div_cnt + 4'b1;

end


//gen flash_clk

always @(posedge sys_clk or negedge sys_rst_n) begin 

    if (sys_rst_n ==1'b0) 

     flash_clk <= 1'b0 ;

    else if ( div_cnt <= 4'd7 ) 

        flash_clk <= 1'b1 ;

    else  

        flash_clk <= 1'b0 ;

end


// flash ctrl signal gen 


// read FLASH devid need 5 step :


// ctrl_cnt  10 - 13 is write oxaa in addr 0x5555 

// ctrl_cnt  14 - 17 is write ox55 in addr 0x2aaa 

// ctrl_cnt  18 - 21 is write ox90 in addr 0x5555 


// ctrl_cnt  22 -30 is wait time for TIDA

// ctrl_cnt  31 -34 is read manId in addr 0

// ctrl_cnt  35 -38 is read devid in addr

部分文件列表

文件名大小
FLASH/
FLASH/FLASH_TEST.asm.rpt8KB
FLASH/FLASH_TEST.cdf
FLASH/FLASH_TEST.done
FLASH/FLASH_TEST.fit.rpt
FLASH/FLASH_TEST.fit.smsg1KB
FLASH/FLASH_TEST.fit.summary1KB
FLASH/FLASH_TEST.flow.rpt
FLASH/FLASH_TEST.jdi4KB
FLASH/FLASH_TEST.map.rpt
FLASH/FLASH_TEST.map.summary
...

【关注B站账户领20积分】

全部评论(0)

暂无评论

上传资源 上传优质资源有赏金

  • 打赏
  • 30日榜单

推荐下载