Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix a few bugs in the oled module's startup sequence
- Loading branch information
Showing
2 changed files
with
63 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,49 @@ | |||
`default_nettype none | |||
`timescale 1ns / 1ps | |||
|
|||
module oled_spi_tb; | |||
|
|||
// Inputs | |||
reg clock; | |||
reg reset; | |||
reg shutdown; | |||
|
|||
// Outputs | |||
wire cs; | |||
wire sdin; | |||
wire sclk; | |||
wire dc; | |||
wire res; | |||
wire vbatc; | |||
wire vddc; | |||
|
|||
// Instantiate the Unit Under Test (UUT) | |||
oled_spi uut ( | |||
.clock(clock), | |||
.reset(reset), | |||
.shutdown(shutdown), | |||
.cs(cs), | |||
.sdin(sdin), | |||
.sclk(sclk), | |||
.dc(dc), | |||
.res(res), | |||
.vbatc(vbatc), | |||
.vddc(vddc) | |||
); | |||
|
|||
initial begin | |||
// Initialize Inputs | |||
clock = 0; | |||
reset = 1; | |||
shutdown = 0; | |||
|
|||
// Wait 100 ns for global reset to finish | |||
#100 reset = 0; | |||
end | |||
|
|||
always begin | |||
#10 clock = !clock; | |||
end | |||
|
|||
endmodule | |||
|