Skip to content

Instantly share code, notes, and snippets.

@goran-mahovlic
Created December 31, 2019 13:40
Show Gist options
  • Save goran-mahovlic/0e83f9978ae34f38caf7c8523931bce2 to your computer and use it in GitHub Desktop.
Save goran-mahovlic/0e83f9978ae34f38caf7c8523931bce2 to your computer and use it in GitHub Desktop.
module dvi_in_out
(
input clk_25mhz,
input [6:0] btn,
output [7:0] led,
output [3:0] gpdi_dp, gpdi_dn,
input [27:0] gp,
output wifi_gpio0
);
parameter C_ddr = 1'b1; // 0:SDR 1:DDR
// wifi_gpio0=1 keeps board from rebooting
// hold btn0 to let ESP32 take control over the board
assign wifi_gpio0 = btn[0];
assign gpdi_dp[2:0] = gp[11:9];
OLVDS OLVDS_clock (.A(clk_recovery), .Z(gpdi_dp[3]) /*,.ZN(gpdi_dn[3]) */);
// clock generator
wire clk_recovery;
clk_25_25
clock_instance
(
.clki(gp[12]),
.clko(clk_recovery)
);
reg [23:0] blink;
always @(posedge clk_recovery)
blink <= blink+1;
assign led[0] = blink[23];
endmodule
@tommythorn
Copy link

Thanks, that's stunningly simple and I'm surprised that you don't need to synchronize the outputs on the way out.

@goran-mahovlic
Copy link
Author

goran-mahovlic commented Apr 3, 2020

Well yes, we still need to see what will happen once we add more logic to it.

I also have tested this on envox addon board - that is using same logic -- just forwarding LVDS signals

https://twitter.com/GMahovlic/status/1234523139914313730

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment