|
本次测试所用到的温湿度传感器是盛思锐公司的sht20(IIC通信),可以同时测量温/湿度。详细介绍如下所示:
测试平台:ALINX 开发板AX301 FPGA芯片:Cyclone IV E:EP4CE10F17C8
所使用的软件:Quartus II 13.1 (64-bit);Nios ll-Eclipse 13.1
在这里我就不贴出BSP文件了。
Verilog顶层代码(我所搭建的qsys系统不只是包含sht20模块,还有其他的模块,仅供参考):
module nios2(
input clk_50M,
input rst_n,
input uart_rxd,
input epcs_flash_data0,
input pio_key,
output sdram_clk,
output [12:0]sdram_addr,
output [1:0]sdram_ba,
output sdram_cas_n,
output sdram_cke,
output sdram_cs_n,
output [1:0]sdram_dqm,
output sdram_ras_n,
output sdram_we_n,
output uart_txd,
output epcs_flash_dclk,
output epcs_flash_sce,
output epcs_flash_sdo,
output [3:0]pio_led,
output [5:0]sel,
output [7:0]seg_led,
output lcd_cs,
output lcd_rs,
output lcd_scl,
output lcd_sda,
output lcd_rst,
inout [15:0]sdram_dq,
inout i2c_scl,
inout i2c_sda
);
wire clk_100M;
pll pll_inst (
.inclk0(clk_50M),
.c0 (clk_100M),
.c1 (sdram_clk)
);
kernel u0 (
.clk_clk (clk_100M),
.reset_reset_n (rst_n),
.epcs_flash_dclk (epcs_flash_dclk),
.epcs_flash_sce (epcs_flash_sce),
.epcs_flash_sdo (epcs_flash_sdo),
.epcs_flash_data0 (epcs_flash_data0),
.i2c_scl_pad_io (i2c_scl),
.i2c_sda_pad_io (i2c_sda),
.uart_rxd (uart_rxd),
.uart_txd (uart_txd),
.sdram_addr (sdram_addr),
.sdram_ba (sdram_ba),
.sdram_cas_n (sdram_cas_n),
.sdram_cke (sdram_cke),
.sdram_cs_n (sdram_cs_n),
.sdram_dq (sdram_dq),
.sdram_dqm (sdram_dqm),
.sdram_ras_n (sdram_ras_n),
.sdram_we_n (sdram_we_n),
.pio_led_export (pio_led),
.pio_key_export (~pio_key),
.segled_controller_sel (sel),
.segled_controller_seg_led (seg_led),
.lcd_cs_export (lcd_cs),
.lcd_rs_export (lcd_rs),
.lcd_scl_export (lcd_scl),
.lcd_sda_export (lcd_sda),
.lcd_rst_export (lcd_rst)
);
endmodule
|
评分
-
查看全部评分
|