Our Pluto I board has Altera ACEX1K Family and Chip is EP1K10TC100-3.
Pin Connections-
- CLK-71
- INT-70
- ADDR-26
- data-6
- wr-23
- rd-28
- wait-50
- INT3-70
module ledmmio(clk, LED,ADDR,wr,rd,data,rdwait,intt);
input clk;
output LED;
input ADDR;
input wr;
input rd;
inout data;
inout rdwait;
inout intt;
reg [0:0]rdwait1;
reg [0:0]data1;
reg [0:0]data2 = 0;
reg [0:0]LEDval = 0;
reg [0:0]intt1 = 1;
reg [4:0]timer = 0;
always @(posedge clk)
begin
if(ADDR == 0 && rd == 0) /*Read*/
begin
data1 = data2;
LEDval <= data2;
rdwait1 <= 1'b0;
intt1 <= 1'bz;
timer = 1;
end
else if(ADDR == 0 && wr == 0) /*Write*/
begin
data1 = (data);
LEDval <=data1;
data2 = data1;
rdwait1 <=1'b0;
intt1 <= 1'bz;
timer = 1;
end
else /*Not in Read/Write*/
begin
if(timer > 0) /*Int gen after some clk cylc*/
begin
if(timer > 28 && timer <= 31) intt1 <= 1'b0;
timer = (timer == 5'b11111) ? 0 : timer + 1'b1;
end
data1 = 1'bz;
rdwait1 <= 1'bz;
if(timer == 0)intt1 <= 1'bz;
end
end
assign data = data1;
assign LED = LEDval;
assign rdwait = rdwait1;
assign intt = intt1;
endmodule
Please note - wr, rd, wait, INT and ADDR (Chip Select) are all negative logic signals.
Zero means they have been activated.
‹
#
›