Commit de821c1d authored by Tristan Gingold's avatar Tristan Gingold

Move gc_ds182x_readout to a subdir, add README.

parent 2c67ec27
......@@ -31,7 +31,7 @@ files = [
"gc_dec_8b10b.vhd",
"gc_dyn_extend_pulse.vhd",
"gc_ds182x_interface.vhd",
"gc_ds182x_readout.vhd",
"gc_ds182x_readout/gc_ds182x_readout.vhd",
"gc_sfp_i2c_adapter.vhd",
"gc_async_counter_diff.vhd",
"gc_sync_word_wr.vhd",
......
This diff is collapsed.
## gc_ds182x_readout
The gc_ds182x_readout core provides a direct interface to the high-precision 1-wire digital termometer DS1820 chip.
The temperature is read every second. The read process is either triggered by the `pps_p_i` input or started automatically from the clock if the generic `g_USE_INTERNAL_PPS` is set to True. Note that the DS18B20 chip needs up to 750ms to read the temperature.
It is important to correctly set the frequency as the 1-wire protocol is time based.
When using the DS18B20 (like on the SPEC), the temperature is in 1/16 degrees.
\ No newline at end of file
......@@ -59,8 +59,8 @@ architecture arch of gc_ds182x_readout is
constant SLOT_CNT_START : unsigned(15 downto 0) := to_unsigned(0*g_CLOCK_FREQ_KHZ/40000, 16);
constant SLOT_CNT_START_PLUSONE : unsigned(15 downto 0) := SLOT_CNT_START + 1;
constant SLOT_CNT_SET : unsigned(15 downto 0) := to_unsigned(60*g_CLOCK_FREQ_KHZ/40000, 16);
constant SLOT_CNT_RD : unsigned(15 downto 0) := to_unsigned(600*g_CLOCK_FREQ_KHZ/40000, 16);
constant SLOT_CNT_STOP : unsigned(15 downto 0) := to_unsigned(3600*g_CLOCK_FREQ_KHZ/40000, 16);
constant SLOT_CNT_RD : unsigned(15 downto 0) := to_unsigned(600*g_CLOCK_FREQ_KHZ/40000, 16); -- 15us
constant SLOT_CNT_STOP : unsigned(15 downto 0) := to_unsigned(3600*g_CLOCK_FREQ_KHZ/40000, 16); -- 90us
constant SLOT_CNT_PRESTOP : unsigned(15 downto 0) := to_unsigned((3600-60)*g_CLOCK_FREQ_KHZ/40000, 16);
constant READ_ID_HEADER : std_logic_vector(7 downto 0) := X"33";
......@@ -225,6 +225,7 @@ begin
case state_op is
when READ_ID_OP =>
-- Read the ROM (unique ID). This is done once after reset.
header <= READ_ID_HEADER;
bit_top <= ID_LGTH;
if state_cm = IDLE_CM then
......@@ -232,14 +233,17 @@ begin
end if;
when CONV_OP1 =>
-- Start conversion.
header <= CONVERT_HEADER;
cm_only <= '1';
when SKIP_ROM_OP1 =>
-- Skip rom to directly reads the registers.
header <= SKIPHEADER;
cm_only <= '1';
when READ_TEMP_OP =>
-- Read registers
header <= READ_TEMPER_HEADER;
bit_top <= TEMPER_LGTH;
if state_cm = IDLE_CM then
......@@ -247,10 +251,12 @@ begin
end if;
when SKIP_ROM_OP2 =>
-- Skip rom to directly reads the registers.
header <= SKIPHEADER;
cm_only <= '1';
when CONV_OP2 =>
-- Start conversion.
header <= CONVERT_HEADER;
cm_only <= '1';
......@@ -364,11 +370,13 @@ begin
crc_ok <= '0';
case state_cm is
when RST_CM =>
-- Reset pulse.
rst_bit_cnt <= '1';
nx_serial_id_out <= '0';
nx_serial_id_oe <= '1';
init <= start_p;
when PREP_WR_CM =>
-- Presence pulse.
rst_bit_cnt <= start_p;
nx_serial_id_oe <= '0';
nx_serial_id_out <= '0';
......
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