Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python_test_scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
python_test_scripts
Merge requests
!6
Apsct ad9511
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Apsct ad9511
APSCT_AD9511
into
master
Overview
1
Commits
9
Pipelines
0
Changes
1
Merged
Apsct ad9511
Gijs Schoonderbeek
requested to merge
APSCT_AD9511
into
master
Mar 1, 2023
Overview
1
Commits
9
Pipelines
0
Changes
1
With this change the code is ready for APSCT rev. 3
0
0
Merge request reports
Viewing commit
7ca7abef
Prev
Next
Show latest version
1 file
+
12
−
9
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
7ca7abef
Loss of lock circuit is working
· 7ca7abef
Gijs Schoonderbeek
authored
Feb 23, 2023
apsct_lib.py
+
12
−
9
View file @ 7ca7abef
Edit in single-file editor
Open in Web IDE
Show full file
@@ -299,8 +299,8 @@ class PllClass:
i2_c_io_device
.
write_bytes
(
0x06
,
0x2C
)
# '0' is output
i2_c_io_device
.
write_bytes
(
0x07
,
0x00
)
# '0' is output
ack
,
ret_value
=
i2_c_io_device
.
read_bytes
(
0x00
,
1
)
status_pll
=
int
(
ret_value
)
&
0x0
2
if
status_pll
==
0x02
:
status_pll
=
int
(
ret_value
,
16
)
&
0x0
4
if
status_pll
:
self
.
lock
=
True
stri
=
f
"
PLL
{
self
.
frequency
}
is in lock
"
else
:
@@ -319,13 +319,14 @@ class PllClass:
i2_c_io_device_b
=
I2C
(
0x21
,
BUSNR
=
I2CBUSNR
)
i2_c_io_device_b
.
write_bytes
(
0x06
,
0x2C
)
# '0' is output
i2_c_io_device_b
.
write_bytes
(
0x07
,
0xFF
)
# '0' is output
ack
,
ret_value
=
i2_c_io_device_b
.
read_bytes
(
0x01
,
1
)
status_reg
=
int
(
ret_value
,
16
)
if
(
self
.
frequency
==
'
200MHz
'
)
&
((
status_reg
&
0x10
)
>
0
):
print
(
"
200MHz has lost lock
"
)
if
((
status_reg
&
0x20
)
>
0
)
&
(
self
.
frequency
==
'
160MHz
'
):
print
(
"
160MHz has last lock
"
)
if
(
self
.
frequency
==
'
200MHz
'
):
lol
=
(
status_reg
&
0x10
)
else
:
lol
=
(
status_reg
&
0x20
)
if
lol
:
print
(
f
"
{
self
.
frequency
}
has lost lock
"
)
ack
,
ret_value
=
i2_c_io_device_a
.
read_bytes
(
0x01
,
1
)
old_reg
=
int
(
ret_value
,
16
)
i2_c_io_device_a
.
write_bytes
(
0x03
,
(
old_reg
|
0x10
))
# '0' is output
@@ -651,12 +652,14 @@ def main():
if
False
:
apsct
.
power
(
False
)
sleep
(
1
)
apsct
.
power
(
True
)
sleep
(
1
)
#
apsct.power(True)
#
sleep(1)
if
False
:
apsct
.
pll_200
.
write_byte_pll
(
0x06
,
0xA5
)
apsct
.
pll_200
.
write_byte_pll
(
0x5A
,
0x01
)
apsct
.
pll_200
.
setup_pll
()
apsct
.
pll_200
.
read_lol
()
apsct
.
pll_200
.
read_lock
()
# apsct.pll_200.read_all_regs_pll()
# apsct.sensors.read_all_voltages()
Loading