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
4b886719
Commit
4b886719
authored
Nov 11, 2011
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print read and expected values. In case of error raise exception at the end of the test.
parent
13b9c8ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
test05.py
test/fmcadc100m14b4cha/python/test05.py
+10
-4
No files found.
test/fmcadc100m14b4cha/python/test05.py
View file @
4b886719
...
@@ -20,7 +20,7 @@ test05: Test LTC2174 ADC
...
@@ -20,7 +20,7 @@ test05: Test LTC2174 ADC
Note: Requires test00.py to run first to load the firmware!
Note: Requires test00.py to run first to load the firmware!
"""
"""
TEST_PATTERN
=
0x3
A5
TEST_PATTERN
=
0x3
FFF
NB_CHANNELS
=
4
NB_CHANNELS
=
4
def
main
(
default_directory
=
'.'
):
def
main
(
default_directory
=
'.'
):
...
@@ -47,6 +47,7 @@ def main (default_directory='.'):
...
@@ -47,6 +47,7 @@ def main (default_directory='.'):
# Read and check test pattern
# Read and check test pattern
pattern
=
fmc
.
get_testpat
()
pattern
=
fmc
.
get_testpat
()
if
(
TEST_PATTERN
!=
pattern
):
if
(
TEST_PATTERN
!=
pattern
):
print
(
'pattern:
%.4
X read:
%.4
X'
)
%
(
TEST_PATTERN
,
pattern
)
raise
PtsError
(
'Cannot access LTC2174 ADC through SPI'
)
raise
PtsError
(
'Cannot access LTC2174 ADC through SPI'
)
# Print LTC2174 configuration
# Print LTC2174 configuration
...
@@ -57,11 +58,16 @@ def main (default_directory='.'):
...
@@ -57,11 +58,16 @@ def main (default_directory='.'):
raise
PtsError
(
'SerDes are not synchronised'
)
raise
PtsError
(
'SerDes are not synchronised'
)
# Read channels current data register
# Read channels current data register
error
=
0
for
i
in
range
(
1
,
NB_CHANNELS
+
1
):
for
i
in
range
(
1
,
NB_CHANNELS
+
1
):
adc_value
=
fmc
.
get_current_adc_value
(
i
)
adc_value
=
fmc
.
get_current_adc_value
(
i
)
print
(
'ADC channel
%
d value:0x
%.4
X'
)
%
(
i
,
(
adc_value
>>
2
))
print
(
'ADC channel
%
d value:0x
%.4
X expected:0x
%.4
X'
)
%
(
i
,
adc_value
,
(
TEST_PATTERN
<<
2
))
if
(
TEST_PATTERN
!=
(
adc_value
>>
2
)):
if
((
TEST_PATTERN
<<
2
)
!=
adc_value
):
raise
PtsError
(
'Data read from LTC2174 ADC are wrong for channel
%
d'
%
i
)
print
(
'Error: value mismatch!'
)
error
+=
1
if
(
error
!=
0
):
raise
PtsError
(
'Data read from LTC2174 ADC are wrong for one or more channels.'
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
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