Commit 50840ab8 authored by Theodor-Adrian Stana's avatar Theodor-Adrian Stana

sw: Renamed RS485 test script and made additions to it

The main additions consist in checking for (and exiting on) wrong RTM detection
line readout, which indicates either a missing RTM, or that the Schmitt trigger
is a dud.

Then, the script also exits when the response of the PTS user to the questions
about the connections is a "no".

These two changes are both done to not waste time and energy on performing tests
on fundamentally wrong test conditions.

Finally, the pulses are enabled when performing fail-safe tests (MUX sel lines
"11"), since otherwise the test would pass without giving any useful information
on this test, as the HDL behaves in the same way if the RS-485 xceivers are
disabled or if they are in fail-safe.
parent f67357cf
......@@ -83,15 +83,24 @@ def main(bus, tname, inf, log):
tests : RS-485 pulse repetition, RS-485 transceivers IC31-IC56,
solid-state switches IC56-IC75, solid-state switches
IC23-IC28, RS-485 transceivers IC16-IC21, Schmitt trigger
inputs IC30, IC45, NAND gate IC8
uses : pts.bit and rs485_pulse.py
inputs IC30, IC45, NAND gate IC8, IC69 Schmitt trigger for
the RTM detection lines
uses : pts.bit and rs485_pulse_rtm.py
"""
pel = PTS_ERROR_LOGGER(inf, log)
try:
raw_input("RENAME ME & CHECK THE RTM LINES")
# Read RTM lines
rtm = (bus.vv_read(CSR) >> CSR_RTM_OFS) & 0x3f
if (rtm == 0x09):
msg = "RTM detection lines read correctly: 0x%02X" % rtm
inf.write(msg+'\n')
else:
msg = "ERROR: RTM detection lines readout (0x%02X) incorrect - expected 0x09. Check RTM presence or IC69" % rtm
pel.set(msg)
return pel.get()
# Initialize a pulse counter object
pc = CPulseCounter(bus, PULSE_CNT_BASE)
......@@ -112,7 +121,7 @@ def main(bus, tname, inf, log):
if "no" in reply.lower():
msg = "ERROR: Control connections to RS485 tester not made"
pel.set(msg)
break
return pel.get()
else:
reply = raw_input('Please type "yes" or "no" to continue: ')
......@@ -181,6 +190,7 @@ def main(bus, tname, inf, log):
mux_sel(bus, 0x3)
inf.write('\n')
inf.write(msg+'\n')
en_pulse_gen(bus)
val = bus.vv_read(LSR)
val >>= LSR_REARFS_OFS
if (val == 0x3f):
......@@ -189,6 +199,7 @@ def main(bus, tname, inf, log):
else:
msg = "ERROR: Failsafe lines readout (0x%02X) incorrect - expected 0x3F" % val
pel.set(msg)
dis_pulse_gen(bus)
# Disable multiplexer
print("Disabling multiplexers")
......@@ -263,6 +274,7 @@ def main(bus, tname, inf, log):
mux_sel(bus, 0x3)
inf.write('\n')
inf.write(msg+'\n')
en_pulse_gen(bus)
val = bus.vv_read(LSR)
val >>= LSR_REARFS_OFS
if (val == 0x3f):
......@@ -271,6 +283,7 @@ def main(bus, tname, inf, log):
else:
msg = "ERROR: Failsafe lines readout (0x%02X) incorrect - expected 0x3F" % val
pel.set(msg)
dis_pulse_gen(bus)
# Disable multiplexer
print("Disabling multiplexers")
......
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