Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
Conv TTL Blocking - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Conv TTL Blocking - Testing
Commits
34ceef04
Commit
34ceef04
authored
Dec 04, 2014
by
Theodor-Adrian Stana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw-fm: Updated TTL pulse test
The test now gives off better output and uses the new bit names in the CSR.
parent
b7322e85
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
6 deletions
+26
-6
ttl_pulse_switch.py
fm/pts/python/ttl_pulse_switch.py
+26
-6
No files found.
fm/pts/python/ttl_pulse_switch.py
View file @
34ceef04
...
...
@@ -122,6 +122,12 @@ class CPulseCounter:
def
wr_reg
(
self
,
addr
,
val
):
self
.
bus
.
vv_write
(
self
.
base
+
addr
,
val
)
def
wr_out_cnt
(
self
,
chan
,
val
):
return
self
.
wr_reg
((
chan
-
1
)
*
8
,
val
)
def
wr_in_cnt
(
self
,
chan
,
val
):
return
self
.
wr_reg
((
chan
-
1
)
*
8
+
4
,
val
)
def
rd_reg
(
self
,
addr
):
return
self
.
bus
.
vv_read
(
self
.
base
+
addr
)
...
...
@@ -144,17 +150,25 @@ def main(bus, tname, inf, log):
pel
=
PTS_ERROR_LOGGER
(
inf
,
log
)
chans
=
[
'1'
,
'2'
,
'3'
,
'4'
,
'5'
,
'6'
,
'A'
,
'B'
,
'C'
,
'D'
]
try
:
# Initialize a pulse counter object
pc
=
CPulseCounter
(
bus
,
PULSE_CNT_BASE
)
# Enable pulse generation while keeping the status LEDs sequencing
val
=
(
1
<<
CSR_TTL_EN_OFS
)
|
(
1
<<
CSR_STAT_LED_EN_OFS
)
# Clear pulse counters for the TTL channels
for
i
in
range
(
1
,
11
):
pc
.
wr_out_cnt
(
i
,
0
)
pc
.
wr_in_cnt
(
i
,
0
)
# Enable pulse generation
val
=
bus
.
vv_read
(
CSR
)
val
|=
(
1
<<
CSR_TTLPT_OFS
)
bus
.
vv_write
(
CSR
,
val
)
# wait one second, then disable pulse generation
time
.
sleep
(
1
)
val
=
1
<<
CSR_STAT_LED_EN_OFS
val
&=
~
(
1
<<
CSR_TTLPT_OFS
)
bus
.
vv_write
(
CSR
,
val
)
# Read the channel registers
...
...
@@ -166,17 +180,23 @@ def main(bus, tname, inf, log):
# First, check for all-zeroes in counters, indicating enable NAND gate failure
if
all
(
ic
==
0
for
ic
in
ic_arr
):
msg
=
"ERROR: No pulses received
, check
enable NAND gate IC10"
msg
=
"ERROR: No pulses received
- check daisy-chain, or
enable NAND gate IC10"
pel
.
set
(
msg
)
# Then, check if the number of pulses sent on the previous channel has
# been received correctly on the current channel
for
i
in
range
(
0
,
10
):
if
(
ic_arr
[
i
]
!=
0
)
and
(
ic_arr
[
i
]
==
oc_arr
[
i
-
1
]):
msg
=
"C
H
%
d received
%
d pulses and sent
%
d pulses - good
\n
"
%
(
i
+
1
,
ic_arr
[
i
],
oc_arr
[
i
])
msg
=
"C
h
%
s received
%
d pulses and sent
%
d pulses - good
\n
"
%
(
chans
[
i
]
,
ic_arr
[
i
],
oc_arr
[
i
])
inf
.
write
(
msg
)
else
:
msg
=
"ERROR: CH
%
d received
%
d pulses and sent
%
d pulses"
%
(
i
+
1
,
ic_arr
[
i
],
oc_arr
[
i
])
msg
=
"ERROR: Ch
%
s received
%
d pulses and sent
%
d pulses - "
%
(
chans
[
i
],
ic_arr
[
i
],
oc_arr
[
i
])
if
(
i
==
0
):
msg
+=
"check daisy-chain, IC6 or IC2, or IC3"
elif
(
i
<
6
):
msg
+=
"check daisy-chain, IC6 or IC2"
else
:
msg
+=
"check daisy-chain, IC11 or IC3"
pel
.
set
(
msg
)
# Switches test
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment