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
f97f959b
Commit
f97f959b
authored
Jul 12, 2017
by
Dave Newbold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding I2C stuff to test script
parent
5492d082
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
test.py
projects/timing/software/test.py
+20
-3
No files found.
projects/timing/software/test.py
View file @
f97f959b
...
...
@@ -6,7 +6,24 @@ import sys
import
collections
uhal
.
setLogLevelTo
(
uhal
.
LogLevel
.
ERROR
)
board
=
uhal
.
getDevice
(
"board"
,
"ipbusudp-2.0://192.168.235.199:50001"
,
"file://addrtab/top.xml"
)
hw
=
uhal
.
getDevice
(
"board"
,
"ipbusudp-2.0://192.168.235.199:50001"
,
"file://addrtab/top.xml"
)
board
.
getNode
(
"csr.ctrl.soft_rst"
)
.
write
(
1
)
# Reset ipbus registers
board
.
dispatch
()
hw
.
getNode
(
"csr.ctrl.soft_rst"
)
.
write
(
1
)
# Reset ipbus registers
hw
.
dispatch
()
clock_I2C
=
I2CCore
(
hw
,
10
,
5
,
"i2c"
,
None
)
zeClock
=
si5344
(
clock_I2C
)
res
=
zeClock
.
getDeviceVersion
()
zeClock
.
setPage
(
0
,
True
)
zeClock
.
getPage
()
regCfgList
=
zeClock
.
parse_clk
(
"Si5344.txt"
)
zeClock
.
writeConfiguration
(
regCfgList
)
hw
.
getNode
(
"io.freq.ctrl.chan_sel"
)
.
write
(
i
);
hw
.
getNode
(
"io.freq.ctrl.en_crap_mode"
)
.
write
(
0
);
hw
.
dispatch
()
time
.
sleep
(
2
)
fq
=
hw
.
getNode
(
"io.freq.freq.count"
)
.
read
();
fv
=
hw
.
getNode
(
"io.freq.freq.valid"
)
.
read
();
hw
.
dispatch
()
print
"Freq:"
,
i
,
int
(
fv
),
int
(
fq
)
*
119.20928
/
1000000
;
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