AN-6130PCIe
HOLT INTEGRATED CIRCUITS
28
if(lwr && ~ads)
WRn <= 1'b0;
// set wr low
end
end
// -------------- 6130 RD & WR LED flashers ---------------
always @(posedge c_delay[18] or negedge RDn)
begin
if (~RDn)
begin
if(add_L == `H6130) // only if 6130
begin
LEDRD <= 1'b0 ;
// Turn on led
counter = 6'b0;
// reset timer
end
end
else
if (counter==3)
LEDRD <= 1'b1;
// turn off led
else counter = c1;
end
always @(posedge c_delay[18] or negedge WRn)
begin
if (~WRn)
begin
if(add_L == `H6130)
// only if 6130
begin
LEDWR <= 1'b0 ;
// Turn on led
counter2 = 6'b0;
// reset timer
end
end
else
if (counter2==3)
LEDWR <= 1'b1; // turn off led
else counter2 = co1;
end
/* ----------- Latched 16 GPIO's -----------*/
// For Latch outputs
always @(posedge WRn or negedge rstn)
begin
if (~rstn)
Latch <= 16'b0001000000110000; // Defaults: LED1 On (low), TXINHA, TXINHB off
else if (add_L == `LatchAddress) // latches decode
Latch <= DataBus; //dbus;
end
// For Latch2 outputs
always @(posedge WRn or negedge rstn)
begin
if (~rstn)
Latch2 <= 16'h002A; // Defaults: all low (00A5 for testing only)
else if (add_L == `Latch2Address) // latches decode
Latch2 <= DataBus; //dbus;
end
/* ------------- Read Input Buffers, or Latches 16 GPIO's ------------*/
always @(*)
begin
if(~RDn & (add_L==`InputsAddress))
oe=1'b1;
// turn on buffer
else if(~RDn & (add_L==`LatchAddress))
oe=1'b1;
// turn on buffer
else if(~RDn & (add_L==`Latch2Address))
oe=1'b1;
// turn on buffer