Commit 08b5b09b authored by Richard R. Carrillo's avatar Richard R. Carrillo

Changed order of FMC-DIO-5chTTLa test-procedure steps

parent ceb84a96
LIST OF ERROR AND WARNING MESSAGES
Author: Richard R. Carrillo, Seven Solutions S.L. <rcarrillo(AT)sevensols.com>
Website: http://www.ohwr.org
Website: http://www.sevensols.com
Revision: 1.2 (Last modifications: 6/5/2012)
This documents describes all the possible messages which can be reported during the execution of PTS of the FMC-DIO-5chTTLa board. These messages can reveal the cause of a test failure.
......@@ -50,6 +57,7 @@ Error in I2C bus. (Addr: x): DIOERR07: Device not initialized
The I2C-device access library has not been properly initialized. This error should never be reported when executing the original FMC-DIO-5chTTLa-board tests.
Possible causes:
- Test-program programming bug.
- An error during device initialization impedes its usage
I2C device DAC (DAC5578) at addr 0x48 produced the error: DIOERR08: Getting channel value: x
The DAC did not respond correctly to the get channel-voltage configuration commands.
......@@ -115,7 +123,7 @@ Execute test06 to obtain more information which could be useful to isolate the p
TSTERR02: Proper voltage reading not obtained in ports: [x] when output enable=1
Apparently the voltage obtained in the ports x is out of the expected range when the port output is set to a high or low level. Alternatively, a misleading wrong voltage could have been measured due to a DAC or comparator operation problem.
Possible causes:
- Something is connected to the LEMO-00 connectors of the ports. Ensure that nothing is connected to the ports while executing this test.
- Something is connected to the LEMO-00 connectors of the ports. Ensure that nothing is connected to the ports while executing the corresponding test.
- Soldering problems (short-circuits) of the corresponding LEMO-00 connectors, corresponding lines (fuses) or voltage clamping components.
- Soldering problems of the corresponding port driver IC or the LVDS-to-LVCMOS IC.
- Soldering problems of the DAC or the corresponding voltage comparator.
......@@ -136,6 +144,7 @@ Check the results of test06 to isolate the problem.
TSTERR04: Proper voltage reading not obtained in ports: [x] when termination resistors enabled
Apparently the voltage obtained in the ports x is out of the expected range when the port output is set to a high level and the termination resistor is enabled. Alternatively, a misleading wrong voltage could have been measured due to a DAC or comparator operation problem.
Possible causes:
- Something is connected to the LEMO-00 connectors of the ports. Ensure that nothing is connected to the ports while executing the corresponding test.
- Soldering problems (short-circuits) of the corresponding LEMO-00 connectors, corresponding lines (fuses) or port input-voltage clamping components.
- Soldering problems of the corresponding port driver IC or the LVDS-to-LVCMOS IC.
- Soldering problems of the DAC or the corresponding voltage comparator.
......@@ -157,7 +166,7 @@ Check the log files to obtain more information about what caused the error.
TSTERR06: Ports x appear no to be correctly connected
No communication could be established through ports x (when the interconnection cables are plugged). That is, the test could use ports x neither as input nor output to communicate with the rest of the ports.
Possible causes:
- Some of the interconnection cables are not correctly connected to the LEMO 00 ports while executing this test.
- Some of the interconnection cables are not correctly connected to the LEMO 00 ports while executing the corresponding test.
- Soldering problems (open-circuits) of the corresponding LEMO 00 connectors or corresponding lines (fuses).
- Soldering problems of the corresponding port driver IC or the LVDS-to-LVCMOS IC.
- Soldering problems of the DAC or the corresponding voltage comparator.
......@@ -176,7 +185,7 @@ Warning messages
TSTWRN00: Strangely-low voltage value obtained in ports: [x] when output=1
Apparently the voltage measured in the ports x is unusually low (but still within the operating range) when the port output is set to a high level.
Possible causes:
- Something is connected to the LEMO-00 connectors of the ports. Ensure that nothing is connected to the ports while executing this test.
- Something is connected to the LEMO-00 connectors of the ports. Ensure that nothing is connected to the ports while executing the corresponding test.
- Soldering problems of the termination-resistor activation circuit (switching transistor)
- Electrical connectivity problems of the corresponding port termination-resistor control lines of the FMC connector.
- An incorrect port current-driver IC is mounted.
......@@ -199,7 +208,7 @@ Check the log files to obtain more information about what caused the error.
TSTWRN03: Strangely-low voltage value obtained in ports: [x] when termination resistors enabled
Apparently the voltage measured in the ports x is unusually low (but still within the operating range) when the port output is set to a high level and the termination resistor is enabled.
Possible causes:
- Something is connected to the LEMO-00 connectors of the ports. Ensure that nothing is connected to the ports while executing this test.
- Something is connected to the LEMO-00 connectors of the ports. Ensure that nothing is connected to the ports while executing the corresponding test.
- Electrical connectivity problems of the corresponding port termination-resistor control lines of the FMC connector.
- An incorrect port current-driver IC is mounted.
Check the log files to obtain more information about what caused the error.
......
......@@ -5,7 +5,7 @@
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version 1.0 (last modifications: 29/4/2012)
# Version 1.1 (last modifications: 5/5/2012)
import rr
import struct
......@@ -20,12 +20,13 @@ from ds18b20 import *
from cdac5578 import *
class CFmcDioError(Exception):
def __init__(self, bus_name, addr, msg):
def __init__(self, bus_name, addr, msg, dio_obj=None):
self.error_msgs={CFmcDio.I2C_ADDR_EEPROM:"EEPROM (24AA64T)",
CFmcDio.I2C_ADDR_DAC:"DAC (DAC5578)"}
self.bus_name = bus_name
self.addr = addr
self.msg = msg
self.bus_name = bus_name # name of the bus in which the error occurred
self.addr = addr # address of the device which caused the error
self.msg = msg # description of the occcurred error
self.dio_obj = dio_obj # sometimes the CFmcDio object before the error occurred
def __str__(self):
if self.bus_name == "FMC":
......@@ -33,7 +34,7 @@ class CFmcDioError(Exception):
elif self.bus_name == "I2C" and self.addr in self.error_msgs.keys():
return "I2C device %s at addr 0x%x produced the error: %s" %(self.error_msgs[self.addr], self.addr, self.msg)
else:
return "Error in "+self.bus_name+" bus. (Addr: "+hex(self.addr)+"): "+self.msg
return "Error in "+self.bus_name+" bus. (Addr: "+(hex(self.addr) if self.addr else "?")+"): "+self.msg
class CFmcDio:
......@@ -64,9 +65,12 @@ class CFmcDio:
"""
self.bus = bus
self.base = base
self.i2c=self.dac=self.eeprom=self.onewire=self.ds1820=None
self.gpio = CGPIO(bus, base + self.BASE_GPIO)
if(not self.fmc_present()):
raise CFmcDioError("FMC", base, "DIOERR00: PRESENT line is not asserted")
for portn in range(5):
self.set_dir(portn, 0) # disable port outputs just in case
if init_eeprom or init_dac: # if any I2C device must be initialized, init the I2C bus
try:
self.i2c = COpenCoresI2C(bus, base + self.BASE_I2C, self.I2C_PRESCALER)
......@@ -77,24 +81,24 @@ class CFmcDio:
board_I2C_periph_addr.append(self.I2C_ADDR_DAC) # Add DAC to the list of required I2C devices
found_I2C_periph_addr=self.i2c.scan()
except I2CDeviceOperationError as e:
raise CFmcDioError("I2C", base, "DIOERR01: Initializing bus: "+e.msg)
raise CFmcDioError("I2C", None, "DIOERR01: Initializing bus: "+e.msg,self)
if not found_I2C_periph_addr:
raise CFmcDioError("I2C", base, "DIOERR02: No I2C device found")
raise CFmcDioError("I2C", None, "DIOERR02: No I2C device found",self)
for periph_addr in board_I2C_periph_addr:
if periph_addr not in found_I2C_periph_addr:
raise CFmcDioError("I2C", periph_addr, "DIOERR03: Device not found. Only "+str(len(found_I2C_periph_addr))+" I2C devices found")
raise CFmcDioError("I2C", periph_addr, "DIOERR03: Device not found. Only "+str(len(found_I2C_periph_addr))+" I2C devices found",self)
if init_eeprom:
try:
self.eeprom = C24AA64(self.i2c, self.I2C_ADDR_EEPROM)
except I2CDeviceOperationError as e:
raise CFmcDioError("I2C", self.I2C_ADDR_EEPROM, "DIOERR04: Initializing: "+e.msg)
raise CFmcDioError("I2C", self.I2C_ADDR_EEPROM, "DIOERR04: Initializing: "+e.msg,self)
else:
self.eeprom=None
if init_dac:
try:
self.dac = CDAC5578(self.i2c, self.I2C_ADDR_DAC);
except I2CDeviceOperationError as e:
raise CFmcDioError("I2C", self.I2C_ADDR_DAC, "DIOERR05: Initializing: "+e.msg)
raise CFmcDioError("I2C", self.I2C_ADDR_DAC, "DIOERR05: Initializing: "+e.msg,self)
else:
self.dac=None
else:
......@@ -219,9 +223,9 @@ class CFmcDio:
try:
return self.ds1820.read_serial_number()
except OneWireDeviceOperationError as e:
raise CFmcDioError("OneWire", 0, "DIOERR09: Getting unique ID: "+e.msg)
raise CFmcDioError("OneWire", None, "DIOERR09: Getting unique ID: "+e.msg)
else:
raise CFmcDioError("OneWire", 0, "DIOERR10: Device not initialized")
raise CFmcDioError("OneWire", None, "DIOERR10: Device not initialized")
def get_temp(self):
""" Returns a temperature value in Celsius degrees by means of the OneWire IC DS1820 """
......@@ -230,10 +234,10 @@ class CFmcDio:
serial_number = self.ds1820.read_serial_number()
temp=self.ds1820.read_temp(serial_number)
except OneWireDeviceOperationError as e:
raise CFmcDioError("OneWire", 0, "DIOERR11: Getting temperature: "+e.msg)
raise CFmcDioError("OneWire", None, "DIOERR11: Getting temperature: "+e.msg)
return temp
else:
raise CFmcDioError("OneWire", 0, "DIOERR10: Device not initialized")
raise CFmcDioError("OneWire", None, "DIOERR10: Device not initialized")
def wr_eeprom(self, mem_addr, data_list):
""" Write a list of bytes (data_list) at the mem_addr address of the board EEPROM (24AA64T)"""
......
......@@ -6,7 +6,7 @@
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version: 1.0 (Last modifications: 29/4/2012)
# Version: 1.1 (Last modifications: 5/5/2012)
from ptsexcept import *
......@@ -45,7 +45,7 @@ class test04:
sys.stdout = sys.__stdout__
tmp_stdin = sys.stdin
sys.stdin = sys.__stdin__
print "¿Are the two fmc-dio-5chttla-board LEDs blinking alternately?"
print "Are the two fmc-dio-5chttla-board LEDs blinking alternately?"
print "Press Y/N and Enter"
ans=""
while ans != "Y" and ans != "N":
......
......@@ -6,7 +6,7 @@
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Website: http://www.sevensols.com
# Version: 1.0 (Last modifications: 29/4/2012)
# Version: 1.1 (Last modifications: 5/5/2012)
from ptsexcept import *
......@@ -38,7 +38,9 @@ class test05:
if e.bus_name == "FMC":
raise PtsCritical(err_msg) # Critical error: the fmc-dio-5chttl-board is apparently not present
else:
raise PtsError(err_msg) # Non-critical error: further tests could be performed successfully
print err_msg # Non-critical error during devices initialization
print "Trying to continue..."
self.dio = e.dio_obj # Recover the created CFmcDio object before the exception was raised so that we can continue
def osc_ports(self):
""" Oscillate state of fmc-dio-5chttl-board ports """
......@@ -47,15 +49,15 @@ class test05:
self.dio.set_out(lemon,1)
ans=""
lemon=0
while ans != "Y" and ans != "N":
while ans <> "Y" and ans <> "N" and ans <> "S":
time.sleep(0.05)
self.dio.set_dir((lemon-1)%5,0)
self.dio.set_dir(lemon,1)
lemon=(lemon+1)%5
if kbhit():
ans=raw_input().upper()
if ans <> "Y" and ans <> "N":
print "The valid inputs are only Y or N and Enter"
if ans <> "Y" and ans <> "N" and ans <> "S":
print "The valid inputs are only Y, N and S and Enter"
for lemon in range(5): # Disable output of all ports
self.dio.set_out(lemon, 0)
self.dio.set_dir(lemon, 0)
......@@ -66,21 +68,13 @@ class test05:
self.dio.set_out(outp,0) # Set port output value to 0
self.dio.set_dir(outp,1) # Enable port output
try:
self.dio.set_in_threshold(inp,self.dio.DACvoltage2value(0.8))
except CFmcDioError as e:
print str(e)
raise PtsError("While setting CDAC5578 channel value: "+str(e))
self.dio.set_in_threshold(inp,self.dio.DACvoltage2value(0.8))
time.sleep(0.010) # wait for the DAC output to stabilize
if not self.dio.get_in(inp): # Low value detected in the input port
self.dio.set_out(outp,1) # Set port output value to 1
try:
self.dio.set_in_threshold(inp,self.dio.DACvoltage2value(1.9))
except CFmcDioError as e:
print str(e)
raise PtsError("While setting CDAC5578 channel value: "+str(e))
self.dio.set_in_threshold(inp,self.dio.DACvoltage2value(1.9))
time.sleep(0.010) # wait for the DAC output to stabilize
if self.dio.get_in(inp): # High value detected in the output port
......@@ -97,11 +91,15 @@ class test05:
def look_for_working_out_in_port_couple(self):
""" look for a port which works as output and another which works as input """
in_out_port_couple=None
for lemoin, lemoout in ((inp,outp) for inp in range(5) for outp in range(5)):
if lemoout <> lemoin: # Check interconnectivity of different ports only
if self.check_port_couple(lemoin,lemoout): # these ports are connected
in_out_port_couple=[lemoin,lemoout]
break
try:
for lemoin, lemoout in ((inp,outp) for inp in range(5) for outp in range(5)):
if lemoout <> lemoin: # Check interconnectivity of different ports only
if self.check_port_couple(lemoin,lemoout): # these ports are connected
in_out_port_couple=[lemoin,lemoout]
break
except CFmcDioError as e:
print "While using CDAC5578 to check interport communication: "+str(e)
print "Trying to continue..."
return in_out_port_couple
def test_port_inter(self):
......@@ -114,13 +112,23 @@ class test05:
sys.stdout = sys.__stdout__
tmp_stdin = sys.stdin
sys.stdin = sys.__stdin__
raw_input("Plug the interconnection cables in the five LEMO-00 connectors of the fmc-dio-5chttla board and press Enter")
raw_input("Ensure that the interconnection cables are plugged in the five LEMO-00 connectors of the fmc-dio-5chttla board and press Enter")
in_out_port_couple=self.look_for_working_out_in_port_couple()
if not in_out_port_couple:
print "TSTERR05: No communication could be performed between any two ports"
msg=self.test_port_out()
emsg=msg[1] # set the new error message reported it by the manual procedure
init_error_msg="No communication could be performed between any two ports"
print init_error_msg
user_ans=self.test_port_out()
if user_ans == "Y" or user_ans == "N": # manual test was performed
msg="The user reported {} operation of board-port outputs".format("a correct" if user_ans=="Y" else "an incorrect") # manual test procedure info message to be printed
else:
msg="The user skipped the manual port-output measurement"
if user_ans == "N":
emsg="TSTERR01: Operation of fmc-dio-5chttla-board ports as output failed" # set the new error message caused by the manual procedure
elif user_ans == "Y":
emsg=None # No error in the end
else:
emsg="TSTERR05:"+init_error_msg # manual test procedure skipped, report initial error
else:
msg=None # No additional message to be printed
unchecked_ports=list(range(5)) # create a list containing the ports to be checked
......@@ -146,22 +154,20 @@ class test05:
sys.stdout = tmp_stdout
sys.stdin = tmp_stdin
if msg:
print msg[0] # print manual procedure message in case it was performed
print msg # print manual procedure message in case it was performed
if emsg:
print emsg # print result error message
return emsg
def test_port_out(self):
""" Port (LEMO 00 connectors) oscillation check """
print "Connect the testing LEDs to the LEMO 00 connectors of the fmc-dio-5chttla-board ports (120ohm serial resistor included)"
print "Connect the testing LEDs (or other measuring instrument) to the LEMO 00 connectors of the fmc-dio-5chttla board (120ohm serial resistor included)"
print "¿Are all the connected testing LEDs blinking alternately?"
print "Press Y/N and Enter"
print "Press Y/N/S (yes/no/skip test) and Enter"
for lemon in range(5): # Disable all termination resistors
self.dio.set_term(lemon, 0)
ans=self.osc_ports()
msg=["The user reported {} operation of board-port outputs".format("a correct" if ans=="Y" else "an incorrect"), "TSTERR01: Operation of fmc-dio-5chttla-board ports as output failed" if ans == "N" else None]
return msg
return ans
def main(default_directory="."):
# Configure the FPGA using the program fpga_loader
......
......@@ -67,7 +67,7 @@ class test08:
port_th.insert(lemon,th1)
port_err=[]
for lemon in range(len(port_th)):
if port_th[lemon]>3.2 or port_th[lemon]<2.8: # normal operating conditions
if port_th[lemon]>3.2 or port_th[lemon]<2.8: # out of normal operating conditions
port_err.append(lemon)
if port_err: # Some errors were detected
ret_error=["E","TSTERR04: Proper voltage reading not obtained in ports: {} when termination resistors enabled".format(port_err)]
......
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