// *********************程序1*****************************
module DMXrw( key_rs,key_w,key_r,dmx_in,sd_moso,sd_insert,sd_wp,
led_w,led_r,dmx_out,sd_mosi,c_485,sd_cs,sd_sck,sd_power
);
//key按下为低电平
input key_w;
input key_rs;
input key_r;
input dmx_in;
input sd_moso;
input sd_insert;
input sd_wp;
output led_w,led_r,dmx_out,sd_mosi,c_485,sd_cs,sd_sck,sd_power;
reg rest_c;
reg sd_rest;
reg led_w;
reg led_r;
reg sd_power;
reg dmx_out;
reg c_485;
reg sd_cs;
reg sd_mosi;
reg sd_sck;
`timescale 1ns/ 100ps;
initial
begin
led_r=1; //led关
led_w=1; //led关
sd_power=1; //sd卡电源关
dmx_out=1;
c_485=1;
sd_cs=1;
sd_mosi=1;
sd_sck=1;
end
endmodule
//**********************程序2***********************
module DMXrw( key_rs,key_w,key_r,dmx_in,sd_moso,sd_insert,sd_wp,
led_w,led_r,dmx_out,sd_mosi,c_485,sd_cs,sd_sck,sd_power
);
//key按下为低电平
input key_w;
input key_rs;
input key_r;
input dmx_in;
input sd_moso;
input sd_insert;
input sd_wp;
output led_w,led_r,dmx_out,sd_mosi,c_485,sd_cs,sd_sck,sd_power;
reg rest_c;
reg sd_rest;
reg led_w;
reg led_r;
reg sd_power;
reg dmx_out;
reg c_485;
reg sd_cs;
reg sd_mosi;
reg sd_sck;
`timescale 1ns/ 100ps;
always
begin
led_r=1; //led关
led_w=1; //led关
sd_power=1; //sd卡电源关
dmx_out=1;
c_485=1;
sd_cs=1;
sd_mosi=1;
sd_sck=1;
end
endmodule
求助各位
为何程序1中用 initial 时,全部输出都不能设定到3.3V高电平,都为0V
而程序2中用 always时,全部输出就能设定到3.3V
(以上程序均经过试验)
|