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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
python_test_scripts
Commits
021c7622
Commit
021c7622
authored
2 years ago
by
Gijs Schoonderbeek
Browse files
Options
Downloads
Patches
Plain Diff
Bug fix 160 MHz, small updates after testing
parent
c612ca69
No related branches found
No related tags found
1 merge request
!3
Apsct production
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
APSCT_I2C.py
+4
-2
4 additions, 2 deletions
APSCT_I2C.py
apsct_lib.py
+12
-6
12 additions, 6 deletions
apsct_lib.py
production_apsct.py
+4
-2
4 additions, 2 deletions
production_apsct.py
with
20 additions
and
10 deletions
APSCT_I2C.py
+
4
−
2
View file @
021c7622
...
...
@@ -63,8 +63,10 @@ EEPROM = 0x50
#
# I2C switch addresses
#
i2c_switch_addr
=
[
0x70
,
0x71
,
0x72
,
0x73
]
i2c_switch_addr_rcu
=
[
0x70
,
0x71
,
0x72
,
0x73
]
i2c_bus_rcu
=
1
i2c_switch_addr_unb
=
[
0x70
]
i2c_bus_unb
=
3
#
# ID Pins
...
...
This diff is collapsed.
Click to expand it.
apsct_lib.py
+
12
−
6
View file @
021c7622
...
...
@@ -43,8 +43,10 @@ class ApsctClass:
self
.
sensors
=
ApsctSensors
()
self
.
pps
=
PpsClass
()
self
.
i2cswitch
=
[]
for
addr
in
APSCT_I2C
.
i2c_switch_addr
:
self
.
i2cswitch
.
append
(
I2cSwitch
(
address
=
addr
))
for
addr
in
APSCT_I2C
.
i2c_switch_addr_rcu
:
self
.
i2cswitch
.
append
(
I2cSwitch
(
address
=
addr
,
bus
=
APSCT_I2C
.
i2c_bus_rcu
))
for
addr
in
APSCT_I2C
.
i2c_switch_addr_unb
:
self
.
i2cswitch
.
append
(
I2cSwitch
(
address
=
addr
,
bus
=
APSCT_I2C
.
i2c_bus_unb
))
self
.
apsct_id
=
ApsctId
()
def
read_IO_expanderis
(
self
):
...
...
@@ -206,7 +208,9 @@ class PllClass:
print
(
f
"
Setup PPL
{
self
.
frequency
}
"
)
self
.
dev_i2c_pll
.
write_bytes
(
0x07
,
0x00
)
if
self
.
frequency
==
'
160MHz
'
:
self
.
dev_i2c_pll
.
write_bytes
(
0x03
,
0x08
)
i2c_address
=
APSCT_I2C
.
PLL_200M
dev_i2c_pll_sel
=
I2C
(
i2c_address
,
BUSNR
=
I2CBUSNR
)
dev_i2c_pll_sel
.
write_bytes
(
0x03
,
0x08
)
else
:
self
.
dev_i2c_pll
.
write_bytes
(
0x03
,
0x28
)
self
.
Write_byte_PLL
(
0x03
,
0x0C
)
...
...
@@ -261,6 +265,7 @@ class PllClass:
stri
=
f
"
PLL
{
self
.
frequency
}
Not locked --> PLL Error
"
if
PRINT_ON
:
print
(
stri
)
return
self
.
lock
def
read_lol
(
self
):
#
...
...
@@ -504,16 +509,17 @@ class I2cSwitch:
#
# Class to check a I2C-switch
#
def
__init__
(
self
,
address
=
0x70
):
def
__init__
(
self
,
address
=
0x70
,
bus
=
1
):
#
# Whats needed to measure the toggle on GPIO24
#
self
.
address
=
address
self
.
bus
=
bus
self
.
dev_i2c_switch
=
I2C
(
address
)
self
.
dev_i2c_switch
.
bus_nr
=
1
self
.
dev_i2c_switch
.
bus_nr
=
bus
def
check_switch
(
self
,
data
=
0xa5
):
print
(
f
"
Check I2C switch at 0x
{
self
.
address
:
x
}
"
,
end
=
'
'
)
print
(
f
"
Check I2C switch at 0x
{
self
.
address
:
x
}
bus
{
self
.
bus
}
"
,
end
=
'
'
)
ret_ack
,
ret_value
=
self
.
dev_i2c_switch
.
read_bytes
(
0
)
if
ret_ack
<
1
:
print
(
"
I2C-Switch not found
"
)
...
...
This diff is collapsed.
Click to expand it.
production_apsct.py
+
4
−
2
View file @
021c7622
...
...
@@ -34,9 +34,9 @@ for mode in modi:
apsct
.
frequency
=
mode
apsct
.
set_apsct
()
if
mode
==
"
200MHz
"
:
apsct
.
pll_200
.
read_lock
()
state
=
state
&
apsct
.
pll_200
.
read_lock
()
if
mode
==
"
160MHz
"
:
apsct
.
pll_160
.
read_lock
()
state
=
state
&
apsct
.
pll_160
.
read_lock
()
apsct
.
frequency
=
"
200MHz
"
apsct
.
set_apsct
()
...
...
@@ -57,3 +57,5 @@ if state:
rw_ok
=
apsct
.
eeprom
.
wr_rd_eeprom
(
serial
,
address
=
0x20
)
if
not
rw_ok
:
print
(
"
EEPROM Error
"
)
else
:
print
(
"
\n
>>> Errors during testing <<<
\n
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment