Skip to content

Instantly share code, notes, and snippets.

@nathanrossi
Created September 2, 2018 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanrossi/2847ec57457d2c576dec43bc3183272b to your computer and use it in GitHub Desktop.
Save nathanrossi/2847ec57457d2c576dec43bc3183272b to your computer and use it in GitHub Desktop.
ice40-lp8k-broken-pll-lock
// pcf
set_io pin_cs F7
set_io pin_sck G7
set_io pin_mosi G6
set_io pin_miso H7
set_io -nowarn pin_usbp A3
set_io -nowarn pin_usbn A4
set_io pin_clk C4
set_io test_led J1
set_io test_clk B2
// module
module bootloader (
input pin_clk,
inout pin_usbp,
inout pin_usbn,
output test_led,
output test_clk,
input pin_miso,
output pin_cs,
output pin_mosi,
output pin_sck
);
// generate 48 mhz clock
wire clk_48mhz;
SB_PLL40_CORE #(
.FEEDBACK_PATH("SIMPLE"),
.DIVR(4'b0000), // DIVR = 0
.DIVF(7'b0101111), // DIVF = 47
.DIVQ(3'b100), // DIVQ = 4
.FILTER_RANGE(3'b001) // FILTER_RANGE = 1
) usb_pll_inst (
.LOCK(test_led),
.RESETB(1'b1),
.BYPASS(1'b0),
.REFERENCECLK(pin_clk),
.PLLOUTCORE(clk_48mhz)
);
assign test_clk = clk_48mhz;
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment