Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Testing
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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 ADC 100M 14b 4cha - Testing
Commits
48e5f4f5
Commit
48e5f4f5
authored
Jan 11, 2012
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typo
parent
502308c9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
test19.py
test/fmcadc100m14b4cha/python/test19.py
+14
-2
No files found.
test/fmcadc100m14b4cha/python/test19.py
View file @
48e5f4f5
...
...
@@ -254,6 +254,18 @@ def calc_gd(Vm1, Vm2, Vm3, Vref1, Vref2):
def
calc_od
(
Vm1
,
Vm2
,
Vm3
,
Vm4
,
Vref1
):
return
((
Vref1
*
(
Vm1
-
Vm2
-
Vm3
+
Vm4
))
/
(
Vm1
-
Vm2
))
def
dump_file_to_eeprom
(
fmc
,
filename
):
eeprom_content
=
[]
eeprom_addr
=
[]
print
filename
f
=
open
(
filename
,
"r+"
)
for
line
in
f
:
addr
,
data
=
line
.
split
()
eeprom_content
=
(
int
(
data
,
2
)
&
0xFF
)
eeprom_addr
=
(
int
(
addr
,
2
))
fmc
.
sys_i2c_eeprom_write
(
eeprom_addr
,[
eeprom_content
])
return
0
def
main
(
default_directory
=
'.'
):
...
...
@@ -648,9 +660,9 @@ def main (default_directory = '.'):
od
.
append
(
calc_od
(
Vm1
[
channel
-
1
],
Vm2
[
channel
-
1
],
Vm3
[
channel
-
1
],
Vm4
[
channel
-
1
],
Vref1
))
print
(
'Channel
%
d DAC offset :
%02.9
f'
)
%
(
channel
,
od
[
channel
-
1
])
#
###########################################################################
#
---------------------------------------------------------------------------
# Calculate correction register values
#
###########################################################################
#
---------------------------------------------------------------------------
# 0x8000 corresponds to 1.0
# Gain correction register is written with 1/gain * 1.0
...
...
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