Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 2cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
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
FMC DEL 1ns 2cha
Commits
d4ca5732
Commit
d4ca5732
authored
Apr 03, 2017
by
Jan Pospisil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more debugging...
parent
8f664e40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
9 deletions
+39
-9
CommonFunctions.py
sw/CommonFunctions.py
+1
-2
FFPG_driver.py
sw/FFPG_driver.py
+38
-7
No files found.
sw/CommonFunctions.py
View file @
d4ca5732
...
...
@@ -51,12 +51,11 @@ def toBin(x, count=8):
""" Integer to binary. Count is number of padding bits """
return
""
.
join
(
map
(
lambda
y
:
str
((
x
>>
y
)
&
1
),
range
(
count
-
1
,
-
1
,
-
1
)))
def
hexDump
(
dataArray
,
bitsPerWord
=
32
,
binary
=
False
):
def
hexDump
(
dataArray
,
bitsPerWord
=
32
,
binary
=
False
,
columns
=
8
):
"""
the ultimate hexDump function
first column is byte-wise address
"""
columns
=
8
i
=
0
for
word
in
dataArray
:
if
i
%
columns
==
0
:
...
...
sw/FFPG_driver.py
View file @
d4ca5732
...
...
@@ -64,7 +64,7 @@ calibrationData = [ # -1 = uncalibrated
fmcSlot
=
1
# 0 | 1
channel
=
2
# 1 | 2
ad9512Config
=
(
ad9512Config
Original
=
(
(
0x34
,
0x01
),
(
0x35
,
0x00
),
(
0x36
,
0x00
),
...
...
@@ -83,6 +83,25 @@ ad9512Config = (
(
0x58
,
0x20
)
)
ad9512Config
=
(
(
0x34
,
0x01
),
(
0x35
,
0x00
),
(
0x36
,
0x00
),
(
0x3f
,
0x03
),
(
0x45
,
0x05
),
(
0x4a
,
0x00
),
(
0x4c
,
0x00
),
(
0x4e
,
0x00
),
(
0x50
,
0x00
),
(
0x52
,
0x00
),
(
0x4b
,
0x40
),
(
0x4d
,
0x40
),
(
0x4f
,
0x40
),
(
0x51
,
0x40
),
(
0x53
,
0x40
),
(
0x58
,
0x20
)
)
def
Ad9512Config
(
pg
,
Config
):
for
Register
in
Config
:
Address
=
Register
[
0
]
...
...
@@ -162,10 +181,12 @@ pg = Ffpg(fmcSlot)
# pg.wb.SetDebugSv("wb_trace.svh")
# initialize the driver
Init
(
pg
)
#
Init(pg)
# create single pulse
TestSinglePulse
(
pg
,
channel
)
# TestSinglePulse(pg, channel)
# TestSinglePulse(pg, 1)
# TestSinglePulse(pg, 2)
# create bunched pulses
# TestBunchPulses(pg, channel)
...
...
@@ -195,19 +216,29 @@ pg.PrintDebug()
# pg.wb.SetDebugSv("")
# pg.wb.SetDebugSv("wb_trace.svh")
# # pg.ad9512._WriteConfig1(0x55)
# # pg.wb.Read("SpiBase", Offset = 1)
# pg.ad9512.Write(0x4A, 0x55)
# pg.ad9512.Write(0x5A, 0x1)
# pg.ad9512.Write(0x4A, 0x55, True)
# print(hex(pg.ad9512.Read(0x4A)))
# print(hex(pg.ad9512.Read(0x4A)))
# print(hex(pg.ad9512.Read(0x4A)))
# print(hex(pg.ad9512.Read(0x4A)))
# print(hex(pg.ad9512.Read(0x4A)))
# print(hex(pg.ad9512.Read(0x4A)))
# pg.wb.SetDebugSv("")
# pg.ad9512.Write(0x4A, 0x55, True)
# while True:
# pg.ad9512.Read(0x4A)
# time.sleep(0.2)
# for i in range(0, 0x5b):
# pg.ad9512.Write(0x4A, 0x55)
# time.sleep(0.2)
# # print "[0x%02x]: 0x%02x" % (i, pg.ad9512.Read(0x4A))
# RegsCount = 0x5A
# Regs = range(0, RegsCount+1)
# for i in range(0, RegsCount+1):
# Regs[i] = pg.ad9512.Read(i)
# hexDump(Regs, bitsPerWord = 8, columns = 1)
...
...
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