首页|资源下载
登录|注册

您现在的位置是:电子研发网 > 资源下载 > FPGA读写DS1302 RTC实验Verilog逻辑源码Quartus工程文件+文档资料 FPG

FPGA读写DS1302 RTC实验Verilog逻辑源码Quartus工程文件+文档资料 FPG

  • 资源大小:5983
  • 上传时间: 2022-09-21
  • 上传用户:ychxg
  • 资源积分:2 下载积分
  • 标      签: fpga ds1302 rtc verilog quartus

资 源 简 介

FPGA读写DS1302 RTC实验Verilog逻辑源码Quartus工程文件+文档资料, FPGA为CYCLONE4系列中的EP4CE6E22C8. 完整的工程文件,可以做为你的学习设计参考。

module DS1302(

input              sys_clk        , 

input              sys_rst_n      ,

output             DS1302_CE      ,

output             DS1302_CLK     ,

inout              DS1302_IO      ,


output    wire     seg_c1         ,

output    wire     seg_c2         ,

output    wire     seg_c3         ,

output    wire     seg_c4         ,

output    wire     seg_a          ,

output    wire     seg_b          ,

output    wire     seg_c          ,

output    wire     seg_e          ,

output    wire     seg_d          ,

output    wire     seg_f          ,

output    wire     seg_g          ,

output    wire     seg_h              


);


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

reg       [3:0]    i                 ;//ִ�в���

reg       [4:0]    rc1_data          ;//������1������

reg       [4:0]    rc2_data          ;//������2������

reg       [4:0]    rc3_data          ;//������3������

reg       [4:0]    rc4_data          ;//������4������

reg       [7:0]    isStart           ;//��ʼ��־

reg       [7:0]    rData             ;//�����ݴ���

reg       [7:0]    sec_data          ;//������

reg       [7:0]    min_data          ;//������


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

wire               Done_Sig          ; //�����ź�

wire      [7:0]    Time_Read_Data    ; //�����ʱ������


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

always @ ( posedge sys_clk or negedge sys_rst_n ) begin

   if  ( !sys_rst_n ) begin

       i <= 4'd0;       //ִ�в�������

       isStart <= 8'd0; //��ʼ��־����

       rData <= 8'd0;   //�����ݴ�������

   end

   else

       case( i )

           0: 

               if  ( Done_Sig ) begin 

          isStart <= 8'd0; 

    i <= i + 1'b1; 

      end

               else begin 

    isStart <= 8'b1000_0000; 

rData <= 8'h00;  //���ݼĴ���д��00h

end

           1:

               if  ( Done_Sig ) begin 

    isStart <= 8'd0; 

i <= i + 1'b1; 

end

          

image.pngimage.png

文 件 预 览

文件名文件大小修改时间
DS1302/Project/cmd_control_module.bsf3KB2014-05-12 17:45:18
DS1302/Project/DS1302.asm.rpt7KB2014-05-12 15:57:34
DS1302/Project/DS1302.cdf1KB2014-05-12 00:46:12
DS1302/Project/DS1302.done1KB2014-05-12 19:31:44
DS1302/Project/DS1302.fit.rpt156KB2014-05-12 15:57:24
DS1302/Project/DS1302.fit.smsg1KB2014-05-12 15:57:22
DS1302/Project/DS1302.fit.summary1KB2014-05-12 15:57:22
DS1302/Project/DS1302.flow.rpt7KB2014-05-12 19:31:42
DS1302/Project/DS1302.jdi1KB2014-05-12 15:57:32
DS1302/Project/DS1302.map.rpt31KB2014-05-12 19:31:42
DS1302/Project/DS1302.map.summary1KB2014-05-12 19:31:42
...

相 关 资 源