`timescale 1us / 1ns module magreader_tf ( output reg RCP, output reg RDP, output reg CLS, output reg reset_button); // This determines how long to wait for the LCD initialization // If your circuit takes longer to initialize the LCD you can increase this delay parameter INITIAL_DELAY = 2000; // The bit interval in microseconds // 100us is a fast swipe 1200us is a slow swipe parameter BIT_INTERVAL = 100; parameter NUM_BITS = 113; // | junk | ES | 2 | = | 1 | + | 1 | ! | Y | A | R | O | O | H | SS |junk | parameter data = 113'b0000000000_0011111_1010010_1011101_1010001_0001011_1010001_0000001_1111001_1100001_0110010_0101111_0101111_1101000_1000101_00000; integer curr; initial begin reset_button = 0; #100 reset_button = 1; output_data; $display("Testing reset"); reset_button = 0; #100 reset_button = 1; output_data; $display("Done sending data"); $stop; end task output_data; begin RCP = 0; RDP = 1; CLS = 1; #INITIAL_DELAY RCP = 1; CLS = 0; #200 for (curr = 0; curr < NUM_BITS; curr = curr + 1) fork #(BIT_INTERVAL/2) RDP = !data[curr]; #(2*BIT_INTERVAL/3) RCP = 0; #BIT_INTERVAL begin RCP = 1; RDP = 1; end join #200 RCP = 0; CLS = 1; end endtask endmodule