forked from tanchou/Verilog
ultrasonic commands commencer et tester mais non fonctionnel donc début de testbench pour pouvoir debuguer
This commit is contained in:
@@ -2,6 +2,7 @@ module top_uart_ultrason (
|
||||
input wire clk, // 27 MHz
|
||||
output wire tx,
|
||||
inout wire sig, // Capteur ultrason
|
||||
output reg [5:0] leds
|
||||
);
|
||||
|
||||
|
||||
@@ -43,7 +44,7 @@ module top_uart_ultrason (
|
||||
reg [8:0] delay_counter = 0;
|
||||
|
||||
always @(posedge clk) begin
|
||||
// Activer en continu tant que FIFO pas pleine
|
||||
leds <= distance[7:2];
|
||||
start <= 1;
|
||||
|
||||
case (state)
|
||||
@@ -63,16 +64,7 @@ module top_uart_ultrason (
|
||||
|
||||
SEND_HIGH: begin
|
||||
wr_data <= distance[15:8]; // Octet MSB
|
||||
state <= WAIT;
|
||||
end
|
||||
|
||||
WAIT: begin // Code non testé
|
||||
if (delay_counter < 1000000) begin
|
||||
delay_counter <= delay_counter + 1;
|
||||
end else begin
|
||||
state <= IDLE;
|
||||
delay_counter <= 0;
|
||||
end
|
||||
state <= IDLE;
|
||||
end
|
||||
|
||||
endcase
|
||||
|
Reference in New Issue
Block a user