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
b90d69da
Commit
b90d69da
authored
Jun 04, 2012
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test20: Work in progress. Get calibration data from EEPROM instead of file.
parent
c84d6d9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
test20.py
test/fmcadc100m14b4cha/python/test20.py
+29
-1
No files found.
test/fmcadc100m14b4cha/python/test20.py
View file @
b90d69da
...
...
@@ -16,9 +16,11 @@ import os
sys
.
path
.
append
(
'../../../'
)
sys
.
path
.
append
(
'../../../gnurabbit/python/'
)
sys
.
path
.
append
(
'../../../common/'
)
sys
.
path
.
append
(
'../../fmceeprom/python/'
)
# Import common modules
from
ptsexcept
import
*
from
fmc_eeprom
import
*
import
rr
# Import specific modules
...
...
@@ -34,6 +36,7 @@ from PAGE.SineWaveform import *
from
ctypes
import
*
"""
test20: Calibration verification
...
...
@@ -232,6 +235,8 @@ def main (default_directory = '.'):
AWG_BAUD
=
57600
CALIBR_FILENAME
=
"calibration_data.txt"
EEPROM_BIN_FILENAME
=
"eeprom_content.out"
EEPROM_SIZE
=
8192
# in Bytes
start_test_time
=
time
.
time
()
...
...
@@ -312,9 +317,32 @@ def main (default_directory = '.'):
f_in
=
open
(
in_filename
,
"r+"
)
for
line
in
f_in
:
all_corr_data
.
append
(
int
(
line
,
16
))
print
"0x
%04
X"
%
all_corr_data
[
-
1
]
#
print "0x%04X" % all_corr_data[-1]
f_in
.
close
()
for
item
in
all_corr_data
:
print
"0x
%04
X"
%
item
# Read entire EEPROM
eeprom_data_read
=
fmc
.
sys_i2c_eeprom_read
(
0
,
EEPROM_SIZE
)
# Write EEPROM data to binary file
f_eeprom
=
open
(
EEPROM_BIN_FILENAME
,
"wb"
)
for
byte
in
eeprom_data_read
:
f_eeprom
.
write
(
chr
(
byte
))
f_eeprom
.
close
()
# Get calibration data
print
"Get calibration data from EEPROM."
eeprom_data
=
open
(
EEPROM_BIN_FILENAME
,
"rb"
)
.
read
()
eeprom_corr_data
=
ipmi_get_internal_use_data
(
eeprom_data
)
#print "Calibration data length (bytes): %d" % len(eeprom_corr_data)
print
"correction data from eeprom"
print
eeprom_corr_data
#for item in eeprom_corr_data:
# print "0x%s" % item
print
"
\n
Get ADC correctioon parameters:"
for
IN_RANGE
in
RANGES
:
for
ch
in
range
(
NB_CHANNELS
):
...
...
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