Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
E
euro-adc-65m-14b-40cha-gw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
eurocard
euro-adc-65m-14b-40cha
euro-adc-65m-14b-40cha-gw
Commits
a52d6ddb
Commit
a52d6ddb
authored
Aug 31, 2017
by
Dave Newbold
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://bitbucket.org/solidexperiment/solid_firmware
parents
6122c974
974d3180
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
align_adc.py
projects/64ch/software/align_adc.py
+18
-14
No files found.
projects/64ch/software/align_adc.py
View file @
a52d6ddb
...
...
@@ -50,7 +50,7 @@ board.dispatch()
time
.
sleep
(
1
)
chans
=
range
(
0x
40
)
chans
=
range
(
0x
1
)
adcs
=
range
(
0x10
)
patt
=
0x0ff
cap_len
=
0x80
...
...
@@ -80,29 +80,32 @@ for i_chan in chans:
res
=
[
False
]
*
(
15
*
taps_per_slip
)
tr
=
[]
for
i_slip
in
range
(
1
4
):
for
i_slip
in
range
(
1
):
ok
=
False
for
i_tap
in
range
(
32
):
board
.
getNode
(
"daq.timing.csr.ctrl.chan_cap"
)
.
write
(
0x1
)
# Capture
board
.
getNode
(
"daq.timing.csr.ctrl.chan_cap"
)
.
write
(
0x0
)
board
.
dispatch
()
r
=
board
.
getNode
(
"daq.chan.csr.stat"
)
.
read
()
board
.
getNode
(
"daq.chan.buf.addr"
)
.
write
(
0x0
)
d
=
board
.
getNode
(
"daq.chan.buf.data"
)
.
readBlock
(
cap_len
)
board
.
dispatch
()
if
r
&
0x1
!=
1
:
print
"Crap no capture"
sys
.
exit
()
time
.
sleep
(
0.01
)
while
True
:
r
=
board
.
getNode
(
"daq.chan.csr.stat"
)
.
read
()
# board.getNode("daq.chan.buf.addr").write(0x0)
# d = board.getNode("daq.chan.buf.data").readBlock(cap_len)
board
.
dispatch
()
if
r
&
0x1
==
1
:
break
print
"Crap no capture"
,
hex
(
i_chan
),
hex
(
i_slip
),
hex
(
i_tap
),
hex
(
r
),
time
.
clock
()
c
=
0
for
w
in
d
:
if
int
(
w
)
&
0x3ff
==
patt
:
c
+=
1
res
[
offsets
[
i_slip
]
*
taps_per_slip
+
(
31
-
i_tap
)]
=
(
c
==
cap_len
)
# for w in d:
# if int(w) & 0x3ff == patt:
# c += 1
# print hex(w),
# print hex(i_chan), hex(i_slip), hex(i_tap), c
res
[
offsets
[
i_slip
]
*
taps_per_slip
+
(
31
-
i_tap
)]
=
(
c
==
cap_len
)
ok
=
(
c
==
cap_len
)
or
ok
board
.
getNode
(
"daq.timing.csr.ctrl.chan_inc"
)
.
write
(
0x1
)
# Increment tap
board
.
getNode
(
"daq.timing.csr.ctrl.chan_inc"
)
.
write
(
0x0
)
board
.
dispatch
()
if
ok
:
tr
.
append
(
i_slip
)
board
.
getNode
(
"daq.timing.csr.ctrl.chan_slip"
)
.
write
(
0x1
)
# Increment slip
...
...
@@ -133,6 +136,7 @@ for i_chan in chans:
a
=
int
((
min
+
max
)
/
2
)
d_slip
=
offsets
.
index
(
a
//
taps_per_slip
)
d_tap
=
a
%
taps_per_slip
print
trp
if
not
non_cont
:
print
"Chan, rec_slip, rec_tap:"
,
hex
(
i_chan
),
hex
(
d_slip
),
hex
(
d_tap
)
else
:
...
...
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