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
4511dc39
Commit
4511dc39
authored
Sep 07, 2011
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add i2c scan check in test02 and test04, add serdes sync check in test05
parent
f1d55d46
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
7 deletions
+39
-7
fmc_adc.py
test/fmcadc100m14b4cha/python/fmc_adc.py
+2
-2
i2c.py
test/fmcadc100m14b4cha/python/i2c.py
+5
-1
test02.py
test/fmcadc100m14b4cha/python/test02.py
+14
-2
test04.py
test/fmcadc100m14b4cha/python/test04.py
+12
-1
test05.py
test/fmcadc100m14b4cha/python/test05.py
+5
-1
test09.py
test/fmcadc100m14b4cha/python/test09.py
+1
-0
No files found.
test/fmcadc100m14b4cha/python/fmc_adc.py
View file @
4511dc39
...
...
@@ -199,12 +199,12 @@ class CFmcAdc100Ms:
# scan FMC i2c bus
def
i2c_scan
(
self
):
print
'
\n
Scan I2C bus'
self
.
fmc_i2c
.
scan
()
return
self
.
fmc_i2c
.
scan
()
# scan FMC system i2c bus
def
sys_i2c_scan
(
self
):
print
'
\n
Scan system I2C bus'
self
.
fmc_sys_i2c
.
scan
()
return
self
.
fmc_sys_i2c
.
scan
()
# Set input range
def
set_input_range
(
self
,
channel
,
range
):
...
...
test/fmcadc100m14b4cha/python/i2c.py
View file @
4511dc39
...
...
@@ -91,6 +91,7 @@ class COpenCoresI2C:
return
self
.
rd_reg
(
self
.
R_RXR
)
def
scan
(
self
):
periph_addr
=
[]
for
i
in
range
(
0
,
128
):
addr
=
i
<<
1
addr
|=
1
...
...
@@ -99,11 +100,14 @@ class COpenCoresI2C:
self
.
wait_busy
()
if
(
not
(
self
.
rd_reg
(
self
.
R_SR
)
&
self
.
SR_RXACK
)):
print
(
"Device found at address:
%.2
X"
)
%
i
periph_addr
.
append
(
i
)
print
(
"Device found at address: 0x
%.2
X"
)
%
i
self
.
wr_reg
(
self
.
R_TXR
,
0
)
self
.
wr_reg
(
self
.
R_CR
,
self
.
CR_STO
|
self
.
CR_WR
)
self
.
wait_busy
()
return
periph_addr
##########################################
# Usage example
...
...
test/fmcadc100m14b4cha/python/test02.py
View file @
4511dc39
...
...
@@ -23,6 +23,8 @@ test02: Test EEPROM and write information data as specified in FMC standard
Note: Requires test00.py to run first to load the firmware!
"""
EEPROM_ADDR
=
0x50
def
main
(
default_directory
=
'.'
):
"""
...
...
@@ -42,8 +44,18 @@ def main (default_directory='.'):
fmc
=
fmc_adc
.
CFmcAdc100Ms
(
spec
)
# Scan FMC system i2c bus
fmc
.
sys_i2c_scan
()
periph_addr
=
fmc
.
sys_i2c_scan
()
# Check that the EEPROM is detected on the I2C bus
if
(
0
==
len
(
periph_addr
)):
raise
PtsError
(
'No peripheral detected on system management I2C bus'
)
else
:
if
(
1
!=
len
(
periph_addr
)):
raise
PtsError
(
'Signal integrity problem detected on system management I2C bus,
%
d devices detected instead of 1'
%
(
len
(
periph_addr
)))
else
:
if
(
EEPROM_ADDR
!=
periph_addr
[
0
]):
raise
PtsError
(
'Wrong device mounted on system management I2C bus, address is:0x
%.2
X expected:0x
%.2
X'
%
(
periph_addr
[
0
],
EEPROM_ADDR
))
if
__name__
==
'__main__'
:
main
();
main
()
test/fmcadc100m14b4cha/python/test04.py
View file @
4511dc39
...
...
@@ -21,6 +21,7 @@ test04: Test Si570 programmable oscillator
Note: Requires test00.py to run first to load the firmware!
"""
SI570_ADDR
=
0x55
SI570_RFREQ
=
42
SI570_N1
=
7
SI570_HS_DIV
=
2
...
...
@@ -44,7 +45,17 @@ def main (default_directory='.'):
fmc
=
fmc_adc
.
CFmcAdc100Ms
(
spec
)
# Scan i2c bus
fmc
.
i2c_scan
()
periph_addr
=
fmc
.
i2c_scan
()
# Check that the EEPROM is detected on the I2C bus
if
(
0
==
len
(
periph_addr
)):
raise
PtsError
(
'No peripheral detected on I2C bus'
)
else
:
if
(
1
!=
len
(
periph_addr
)):
raise
PtsError
(
'Signal integrity problem detected on I2C bus,
%
d devices detected instead of 1'
%
(
len
(
periph_addr
)))
else
:
if
(
SI570_ADDR
!=
periph_addr
[
0
]):
raise
PtsError
(
'Wrong device mounted on I2C bus, address is:0x
%.2
X expected:0x
%.2
X'
%
(
periph_addr
[
0
],
SI570_ADDR
))
# Get Si570 configuration
si570_config
=
fmc
.
get_si570_config
()
...
...
test/fmcadc100m14b4cha/python/test05.py
View file @
4511dc39
...
...
@@ -47,11 +47,15 @@ def main (default_directory='.'):
# Read and check test pattern
pattern
=
fmc
.
get_testpat
()
if
(
TEST_PATTERN
!=
pattern
):
raise
PtsError
(
'Cannot access LTC2174 ADC through
I2C
'
)
raise
PtsError
(
'Cannot access LTC2174 ADC through
SPI
'
)
# Print LTC2174 configuration
fmc
.
print_adc_regs
()
# Check that SerDes are synchronised
if
(
0
==
fmc
.
get_serdes_sync_stat
()):
raise
PtsError
(
'SerDes are not synchronised'
)
# Read channels current data register
for
i
in
range
(
1
,
NB_CHANNELS
+
1
):
adc_value
=
fmc
.
get_current_adc_value
(
i
)
...
...
test/fmcadc100m14b4cha/python/test09.py
View file @
4511dc39
...
...
@@ -13,6 +13,7 @@ import os
from
ptsexcept
import
*
import
gn4124
import
fmc_adc
from
PAGE.Agilent33250A
import
*
from
PAGE.SineWaveform
import
*
...
...
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