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
9e790e64
Commit
9e790e64
authored
Jun 04, 2012
by
Matthieu Cattin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test24: Add a test to read calibration data from CP2103 EEPROM.
parent
6f31ef0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
test24.py
test/fmcadc100m14b4cha/python/test24.py
+64
-0
No files found.
test/fmcadc100m14b4cha/python/test24.py
0 → 100755
View file @
9e790e64
#! /usr/bin/env python
# coding: utf8
# Copyright CERN, 2012
# Author: Matthieu Cattin <matthieu.cattin@cern.ch>
# Licence: GPL v2 or later.
# Website: http://www.ohwr.org
# Last modifications: 4/6/2012
# Import system modules
import
sys
import
time
import
os
import
re
# Add common modules and libraries location to path
sys
.
path
.
append
(
'../../../'
)
sys
.
path
.
append
(
'../../../gnurabbit/python/'
)
sys
.
path
.
append
(
'../../../common/'
)
# Import common modules
from
ptsexcept
import
*
import
rr
# Import specific modules
from
cp210x_eeprom
import
*
from
ctypes
import
*
import
find_usb_tty
"""
test24: Read calibration data from CP2103 EEPROM
The calibration box contains a voltage reference that has to
be calibrated for each input voltage range of the FmcAdc.
A multimeter of at least 6 digits has to be used for the
calibration. The result of the calibration is stored in the
cp2103 EEPROM.
"""
# Calibration box vendor and product IDs
BOX_USB_VENDOR_ID
=
0x10c4
# Cygnal Integrated Products, Inc.
BOX_USB_PRODUCT_ID
=
0xea60
# CP210x Composite Device
def
main
():
try
:
box_eeprom
=
CCP210x_Eeprom
(
"
%
X"
%
BOX_USB_VENDOR_ID
,
"
%
X"
%
BOX_USB_PRODUCT_ID
)
print
"Read calibration data from cp210x EEPROM."
calibr_data
=
box_eeprom
.
get_calibr_data
()
for
range_str
,
value
in
calibr_data
.
iteritems
():
print
"
%5
s range calibration voltage is:
%
s V"
%
(
range_str
,
value
)
except
(
CP210xEepromOperationError
)
as
e
:
raise
PtsError
(
"Test failed:
%
s"
%
e
)
if
__name__
==
'__main__'
:
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