Commit e58bd375 authored by Denia Bouhired-Ferrag's avatar Denia Bouhired-Ferrag

Added scripts for testing the pulse rejection mechanism

parents f8d6788d 283b0325
*pyc
*swp
......@@ -7,3 +7,6 @@
[submodule "conv-ttl-blo-hw"]
path = conv-ttl-blo-hw
url = git@ohwr.org:level-conversion/conv-ttl-blo/conv-ttl-blo-hw.git
[submodule "software/PyBECO"]
path = software/PyBECO
url = https://gitlab.cern.ch/cohtdrivers/PyBECO.git
conv-ttl-blo-gw @ f7e79ef8
Subproject commit 103510645fb5ebdffccb1d2ef5894d832d947da5
Subproject commit f7e79ef83f572ffa778b9cf0a9c06901ed02ba61
PyBECO @ 5978d872
Subproject commit 5978d872aecf76f6842136be225fe5f40aa84bfa
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Memory map for CONV-TTL-BLO
#===============================================================================
# author: Maciej Suminski (maciej.suminski@cern.ch)
#
# date of creation: 02.02.2017
#
# version: 1.0
#
# description:
# This script contains memory map for CONV-TTL-BLO, gateware v4.
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 2.1 of the License, or (at your
# option) any later version. This source is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with this
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
#===============================================================================
# TODO: -
#===============================================================================
# Memory map for gateware v4
SR = 0x04
ERR = 0x08
CR = 0x0c
CH1TTLPCR = 0x10
CH2TTLPCR = 0x14
CH3TTLPCR = 0x18
CH4TTLPCR = 0x1c
CH5TTLPCR = 0x20
CH6TTLPCR = 0x24
CH1BLOPCR = 0x28
CH2BLOPCR = 0x2c
CH3BLOPCR = 0x30
CH4BLOPCR = 0x34
CH5BLOPCR = 0x38
CH6BLOPCR = 0x3c
TVLR = 0x40
TVHR = 0x44
TBMR = 0x48
TBCYR = 0x4c
TBTLR = 0x50
TBTHR = 0x54
TBCSR = 0x58
CH1LTSCYR = 0x5c
UIDLR = 0xac
UIDHR = 0xb0
TEMPR = 0xb4
......@@ -6,6 +6,6 @@ clrchxpcr.py -- Clears the channel pulse counter registers
getsr.py -- Read the board's SR and print the list of fields
mantrig.py -- Manually trigger a pulse on a selected channel
rdchxpcr.py -- Read the channel pulse counter registers
setsr.py -- Set the board's SR, typically for clearing error bits
seterr.py -- Set the board's ERR, typically for clearing error bits
therm.py -- Get the unique ID and temperature from the
DS18B20 thermometer on-board the CONV-TTL-BLO
DS18B20 thermometer on-board the CONV-TTL-BLO
......@@ -4,10 +4,11 @@
# Clear CHxPCR registers on CONV-TTL-BLO
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
# Maciej Suminski (maciej.suminski@cern.ch)
#
# date of creation:
#
# version: 1.0
# version: 1.1
#
# description:
# This script is used to clear the input channel counters on the CONV-TTL-BLO
......@@ -27,8 +28,10 @@
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#===============================================================================
# TODO: -
# TODO: -
#===============================================================================
import time
import sys
......@@ -36,6 +39,8 @@ import time
sys.path.append("../ei2c")
from ei2c import *
import ei2cdefine
sys.path.append("..")
import convttl_regs as regs
if __name__ == "__main__":
......@@ -46,45 +51,26 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME
user = ei2cdefine.USER
pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else:
ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd)
testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot
bid = testelma.get_bid(slot)
# Clear channel
testelma.write(slot, 0x0c, 0)
testelma.write(slot, 0x10, 0)
testelma.write(slot, 0x14, 0)
testelma.write(slot, 0x18, 0)
testelma.write(slot, 0x1c, 0)
testelma.write(slot, 0x20, 0)
# Clear counters
for i in range(6):
testelma.write(slot, regs.CH1TTLPCR + 4 * i, 0)
testelma.write(slot, regs.CH1BLOPCR + 4 * i, 0)
# Print channel counter values, close and exit
print("CH1: %d" % testelma.read(slot, 0x0c))
print("CH2: %d" % testelma.read(slot, 0x10))
print("CH3: %d" % testelma.read(slot, 0x14))
print("CH4: %d" % testelma.read(slot, 0x18))
print("CH5: %d" % testelma.read(slot, 0x1c))
print("CH6: %d" % testelma.read(slot, 0x20))
testelma.close()
# Print channel counter values
for i in range(6):
print("CH%d\tTTL: %d" % (i + 1, testelma.read(slot, regs.CH1TTLPCR + i*4)))
print(" \tBLO: %d" % (testelma.read(slot, regs.CH1BLOPCR + i*4)))
testelma.close()
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Set converter board status register
# Clear bits in the error register
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
# Maciej Suminski (maciej.suminski@cern.ch)
#
# date of creation: 2014-05-02
#
# version: 1.0
# version: 1.1
#
# description:
# Set the converter board status register, typically for clearing set error
# bits.
# Set the converter board errors register, typically for clearing set error
# bits. Note that typically to clear an error, one has to set it to logical
# one.
#
# dependencies:
# ../ei2c/ei2c.py
......@@ -32,6 +34,9 @@
#===============================================================================
# last changes:
# 2014-05-02 Theodor Stana File created
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware,
# renamed from setsr.py to seterr.py
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#===============================================================================
# TODO: -
#===============================================================================
......@@ -41,6 +46,8 @@ import sys
sys.path.append("../ei2c")
from ei2c import *
import ei2cdefine
sys.path.append("..")
import convttl_regs as regs
if __name__ == "__main__":
......@@ -51,40 +58,23 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME
user = ei2cdefine.USER
pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else:
ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd)
testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot
bid = testelma.get_bid(slot)
# Get status register value, set and re-print
v = testelma.read(slot, 0x4)
print("SR (pre-set) : 0x%08x" % v)
print("==========================")
v = raw_input("Value to set : 0x")
v = int(v, 16)
testelma.write(slot, 0x4, v)
print("==========================")
v = testelma.read(slot, 0x4)
print("SR (post-set) : 0x%08x" % v)
# Get error register value, set and re-print
v = testelma.read(slot, regs.ERR)
print("ERR (pre-set) : 0x%08x" % v)
testelma.write(slot, regs.ERR, v)
v = testelma.read(slot, regs.ERR)
print("ERR (post-set) : 0x%08x" % v)
testelma.close()
......@@ -4,10 +4,11 @@
# Retrieve gateware version from CONV-TTL-BLO board
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
# Maciej Suminski (maciej.suminski@cern.ch)
#
# date of creation:
#
# version: 1.0
# version: 1.1
#
# description:
# This script retrieves the value of the CONV-TTL-BLO status register and
......@@ -29,14 +30,18 @@
# last changes:
# 2014-05-02 Theodor Stana Changed to print the bits of the SR
# in turn.
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
# Updated HWVERS mask & offset
#===============================================================================
# TODO: -
# TODO: -
#===============================================================================
import sys
sys.path.append("../ei2c")
from ei2c import *
import ei2cdefine
sys.path.append("..")
import convttl_regs as regs
if __name__ == "__main__":
......@@ -46,40 +51,31 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME
user = ei2cdefine.USER
pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else:
ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd)
testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot
bid = testelma.get_bid(slot)
# Get status register value and print
v = testelma.read(slot, 0x4)
v = testelma.read(slot, regs.SR)
print("Status register : 0x%08x" % v)
print("===============================")
# Strip GWVERS and print
maj = (v & 0xf0) >> 4
min = v & 0x0f
print("Gateware version : v%d.%d (0x%02x)" % (maj, min, v & 0xff))
gwmaj = (v & 0xf0) >> 4
gwmin = v & 0x0f
print("Gateware version : v%d.%d (0x%02x)" % (gwmaj, gwmin, v & 0xff))
if gwmaj < 4:
print("This tool works with gateware v4. Please upgrade your gateware.")
sys.exit()
# Strip SWITCHES and print
switches = (v & 0xff00) >> 8
......@@ -89,12 +85,16 @@ if __name__ == "__main__":
# Gateware versions below these two had the switches active-low.
# This negation is done to allow correct printing of ON or OFF states.
if ((bid == "TBLO") and
(((maj == 0) and (min < 2)) or ((maj != 0) and (maj < 3)))):
(((gwmaj == 0) and (gwmin < 2)) or ((gwmaj != 0) and (gwmaj < 3)))):
switches ^= 0xff
if (switches & 0x80):
print(" TTL repetition : on")
print(" TTL mode : TTL")
else:
print(" TTL repetition : off")
print(" TTL mode : TTL-BAR")
if (switches & 0x02):
print(" Pulse length : short (250 ns)")
else:
print(" Pulse length : long (1.25 us)")
if (switches & 0x01):
print(" Glitch filter : on")
else:
......@@ -105,25 +105,46 @@ if __name__ == "__main__":
rtmm = rtm & 0x7
rtmp = (rtm & 0x3f) >> 3
if ((bid == "TBLO") and
(((maj == 0) and (min < 2)) or ((maj != 0) and (maj < 3)))):
(((gwmaj == 0) and (gwmin < 2)) or ((gwmaj != 0) and (gwmaj < 3)))):
print("-------------------------------")
print("Note: negated w.r.t. latest user guide version")
print("RTM detection : 0x%02x" % rtm)
print(" RTMM[2:0] : %s" % ("{0:#05b}".format(rtmm)[2:]))
print(" RTMP[2:0] : %s" % ("{0:#05b}".format(rtmp)[2:]))
if ((maj == 0) and (min < 2)) or (maj < 3):
if ((gwmaj == 0) and (gwmin < 2)) or (gwmaj < 3):
print("-------------------------------")
# Strip the other status bits and print
print("I2C timeout error : %s" % ("{0:#01b}".format(int(bool(v & (1 << 22))))[2]))
print("White Rabbit pres. : %s" % ("{0:#01b}".format(int(bool(v & (1 << 23))))[2]))
print("I2C address error : %s" % ("{0:#01b}".format(int(bool(v & (1 << 24))))[2]))
print("Pulse miss error : 0x%02x" % ((v & 0x7e000000) >> 24))
print(" CH1 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 25))))[2]))
print(" CH2 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 26))))[2]))
print(" CH3 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 27))))[2]))
print(" CH4 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 28))))[2]))
print(" CH5 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 29))))[2]))
print(" CH6 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 30))))[2]))
# Hardware version
hwmaj = (v & 0x0f000000) >> 24
hwmin = (v & 0x00c00000) >> 22
print("Hardware version : %s"
% ("%d.%d" % (hwmaj, hwmin) if hwmaj >= 4 else "3 or below" ))
# White Rabbit present
wrpres = (v & 0x04000000) >> 8
print("White Rabbit : %s" % ("present" if wrpres else "absent"))
# Get error register value and print
v = testelma.read(slot, regs.ERR)
print("Error register : 0x%08x" % v)
print("===============================")
print("I2C timeout error : %s" % ("{0:#01b}".format(int(bool(v & (1 << 0))))[2]))
print("I2C address error : %s" % ("{0:#01b}".format(int(bool(v & (1 << 1))))[2]))
print("Pulse frequency limit error : 0x%02x" % ((v & 0x000000fc) >> 2))
print(" CH1 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 2))))[2]))
print(" CH2 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 3))))[2]))
print(" CH3 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 4))))[2]))
print(" CH4 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 5))))[2]))
print(" CH5 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 6))))[2]))
print(" CH6 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 7))))[2]))
print("Pulse watchdog error : 0x%02x" % ((v & 0x00003f00) >> 8))
print(" CH1 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 8))))[2]))
print(" CH2 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 9))))[2]))
print(" CH3 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 10))))[2]))
print(" CH4 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 11))))[2]))
print(" CH5 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 12))))[2]))
print(" CH6 : %s" % ("{0:#01b}".format(int(bool(v & (1 << 13))))[2]))
testelma.close()
......@@ -4,10 +4,11 @@
# Manually trigger a pulse
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
# Maciej Suminski (maciej.suminski@cern.ch)
#
# date of creation:
#
# version: 1.0
# version: 1.1
#
# description:
# This script can be used to manually trigger a pulse on the CONV-TTL-BLO
......@@ -27,8 +28,10 @@
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#===============================================================================
# TODO: -
# TODO: -
#===============================================================================
import time
import sys
......@@ -36,6 +39,8 @@ import time
sys.path.append("../ei2c")
from ei2c import *
import ei2cdefine
sys.path.append("..")
import convttl_regs as regs
if __name__ == "__main__":
......@@ -46,39 +51,24 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME
user = ei2cdefine.USER
pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else:
ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd)
testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot
bid = testelma.get_bid(slot)
# Send magic sequence
testelma.write(slot, 0x8, 0xde << 2)
testelma.write(slot, 0x8, 0xad << 2)
testelma.write(slot, 0x8, 0xbe << 2)
testelma.write(slot, 0x8, 0xef << 2)
# Ask for which channel to trigger on, trigger, close and exit
# Ask for which channel to trigger on
chan = input("chan (1..6): ")
testelma.write(slot, 0x8, chan << 2)
testelma.close()
# Send the magic sequence & the channel number
sequence = (0xde, 0xad, 0xbe, 0xef, chan) # password and then channel
for b in sequence:
testelma.write(slot, regs.CR, (b << 2) & 0x3FC)
testelma.close()
......@@ -4,10 +4,11 @@
# Read CHxPCR registers on CONV-TTL-BLO
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
# Maciej Suminski (maciej.suminski@cern.ch)
#
# date of creation:
#
# version: 1.0
# version: 1.1
#
# description:
# This script is used to read the input channel counters on the CONV-TTL-BLO
......@@ -27,8 +28,10 @@
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#===============================================================================
# TODO: -
# TODO: -
#===============================================================================
import time
import sys
......@@ -36,6 +39,8 @@ import time
sys.path.append("../ei2c")
from ei2c import *
import ei2cdefine
sys.path.append("..")
import convttl_regs as regs
if __name__ == "__main__":
......@@ -46,37 +51,21 @@ if __name__ == "__main__":
ip = ei2cdefine.HNAME
user = ei2cdefine.USER
pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else:
ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd)
testelma.open()
# Ask for slot number
while 1:
try:
slot = raw_input("Slot no.: ")
slot = int(slot)
break
except TypeError as e:
print("Please input a decimal slot number.")
except SlotError as e:
print(e.strerror)
except KeyboardInterrupt:
sys.exit();
except:
print("Unexpected error: ", sys.exc_info()[0])
# Print which board is detected in the selected slot
bid = testelma.get_bid(slot)
# Print channel counter values, close and exit
print("CH1: %d" % testelma.read(slot, 0x0c))
print("CH2: %d" % testelma.read(slot, 0x10))
print("CH3: %d" % testelma.read(slot, 0x14))
print("CH4: %d" % testelma.read(slot, 0x18))
print("CH5: %d" % testelma.read(slot, 0x1c))
print("CH6: %d" % testelma.read(slot, 0x20))
testelma.close()
# Print channel counter values
for i in range(6):
print("CH%d\tTTL: %d" % (i + 1, testelma.read(slot, regs.CH1TTLPCR + i*4)))
print(" \tBLO: %d" % (testelma.read(slot, regs.CH1BLOPCR + i*4)))
testelma.close()
#!/usr/bin/python
#===============================================================================
# CERN (BE-CO-HT)
# Set converter board error register
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
# Maciej Suminski (maciej.suminski@cern.ch)
#
# date of creation: 2014-05-02
#
# version: 1.1
#
# description:
# Set the converter board errors register, typically for clearing set error
# bits. Note that typically to clear an error, one has to set it to logical
# one.
#
# dependencies:
# ../ei2c/ei2c.py
# ../ei2c/ei2cdefine.py
#
#===============================================================================
# GNU LESSER GENERAL PUBLIC LICENSE
#===============================================================================
# This source file is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation; either version 2.1 of the License, or (at your
# option) any later version. This source is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with this
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
# 2014-05-02 Theodor Stana File created
# 2017-02-02 M. Suminski Updated mem map to match v4 gateware,
# renamed from setsr.py to seterr.py
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#===============================================================================
# TODO: -
#===============================================================================
import sys
sys.path.append("../ei2c")
from ei2c import *
import ei2cdefine
sys.path.append("..")
import convttl_regs as regs
if __name__ == "__main__":
# Get the IP, user and password for the ELMA crate from either user input,
# or ei2cdefine.py
if (ei2cdefine.ENABLED):
ip = ei2cdefine.HNAME
user = ei2cdefine.USER
pwd = ei2cdefine.PWD
slot = ei2cdefine.SLOT
else:
ip = raw_input("ELMA crate IP or hostname : ")
user = raw_input("ELMA crate user name : ")
pwd = raw_input("ELMA crate password : ")
slot = int(raw_input("ELMA crate slot number : "))
testelma = EI2C(ip, user, pwd)
testelma.open()
# Print which board is detected in the selected slot
bid = testelma.get_bid(slot)
# Get error register value, set and re-print
v = testelma.read(slot, regs.ERR)
print("ERR (pre-set) : 0x%08x" % v)
print("===========================")
v = raw_input("Value to set : 0x")
v = int(v, 16)
testelma.write(slot, regs.ERR, v)
print("===========================")
v = testelma.read(slot, regs.ERR)
print("ERR (post-set) : 0x%08x" % v)
testelma.close()
......@@ -4,10 +4,11 @@
# Read the CONV-TTL-BLO board ID and current temperature from DS18B20 chip
#===============================================================================
# author: Theodor Stana (t.stana@cern.ch)
# Maciej Suminski (maciej.suminski@cern.ch)
#
# date of creation:
#
# version: 1.0
# version: 1.1
#
# description:
# The script implements some classes to communicate to the OpenCores One-Wire
......@@ -28,8 +29,11 @@
# source; if not, download it from http://www.gnu.org/licenses/lgpl-2.1.html
#===============================================================================
# last changes:
# 2017-02-02 M. Suminski Updated to work with gateware v4
# (read regs storing UID & temperature)
# 2017-02-17 M. Suminski Use SLOT configuration from ei2cdefine
#===============================================================================
# TODO: -
# TODO: -
#===============================================================================
# Import system modules
import sys
......@@ -40,33 +44,9 @@ import os
sys.path.append("../ei2c")
from ei2c import *
import ei2cdefine
sys.path.append("..")
import convttl_regs as regs
##------------------------------------------------------------------------------
## DS18B20 class
##------------------------------------------------------------------------------
class CDS18B20:
OFFSET_UIDLR = 0xA8
OFFSET_UIDHR = 0xAC
OFFSET_TEMPR = 0xB0