Commit 933011a5 authored by Jan Pospisil's avatar Jan Pospisil

make OneWire instances better parametrized

parent 4a3aa688
...@@ -214,8 +214,8 @@ begin ...@@ -214,8 +214,8 @@ begin
-- CDR_N = 125MHz * 5.0us - 1 = 625 - 1 = 624 = 0x0270 -- CDR_N = 125MHz * 5.0us - 1 = 625 - 1 = 624 = 0x0270
-- CDR_O = f_CLK * BTP_O - 1 -- CDR_O = f_CLK * BTP_O - 1
-- CDR_O = 125MHz * 1.0us - 1 = 125 - 1 = 124 = 0x007C -- CDR_O = 125MHz * 1.0us - 1 = 125 - 1 = 124 = 0x007C
g_CDR_N => 624, g_CDR_N => (g_ClkFrequency/1e6)*5 - 1,
g_CDR_O => 124 g_CDR_O => (g_ClkFrequency/1e6)*1 - 1
) )
port map ( port map (
clk_sys_i => Clk_ik, clk_sys_i => Clk_ik,
......
...@@ -549,7 +549,9 @@ begin ...@@ -549,7 +549,9 @@ begin
g_address_granularity => BYTE, g_address_granularity => BYTE,
g_num_ports => 1, g_num_ports => 1,
g_ow_btp_normal => "5.0", g_ow_btp_normal => "5.0",
g_ow_btp_overdrive => "1.0" g_ow_btp_overdrive => "1.0",
g_CDR_N => (c_ClkSysFrequency/1e6)*5 - 1,
g_CDR_O => (c_ClkSysFrequency/1e6)*1 - 1
) )
port map ( port map (
clk_sys_i => ClkSys_k, clk_sys_i => ClkSys_k,
......
...@@ -130,7 +130,7 @@ def WaitForNotBusy(register, bit, timeOut, tries, message = '', polarity = 1): ...@@ -130,7 +130,7 @@ def WaitForNotBusy(register, bit, timeOut, tries, message = '', polarity = 1):
def SpiInit(): def SpiInit():
WbWrite('spi_ss', 1) WbWrite('spi_ss', 1)
WbWrite('spi_divider', 2) WbWrite('spi_divider', 2) # up to 150 MHz of FPGA system clock
WbWrite('spi_ctrl', 0x2618) WbWrite('spi_ctrl', 0x2618)
def SpiRead(register): def SpiRead(register):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment