cmosdaq user guide - university of oxfordcmosdaq user guide luigi vigani revision 1 (11/11/2015)...
TRANSCRIPT
![Page 1: cmosdaq User Guide - University of Oxfordcmosdaq User Guide Luigi Vigani Revision 1 (11/11/2015) Introduction cmosdaq is the software package for managing the interface with the CMOS](https://reader033.vdocument.in/reader033/viewer/2022042219/5ec5b28874b3aa2b4907d625/html5/thumbnails/1.jpg)
cmosdaq User Guide
Luigi Vigani
Revision 1 (11/11/2015)
Introduction cmosdaq is the software package for managing the interface with the CMOS detectors developed by the
Atlas Strip CMOS collaboration. You can find the original files in: https://users.physics.ox.ac.uk/~vigani
Requirements
The software runs on Windows machines. It has been tested with Windows 7, 8 and Vista.
For Ethernet communication it relies on Wireshark libraries. ON 64-bit machines I can provide those
libraries, avoiding Wireshark installation, but I recommend it as it can be useful to run it in parallel to
check the bit-stream towards the Ethernet port. Link for the download:
https://www.wireshark.org/download.html
Basic Hardware
The basic system consists of:
Computer
Atlys Board, a commercial FPGA board. It is connected to the computer with an Ethernet cable.
Motherboard, connected to the Atlys through the VHDC connector. For Chess devices there are
two kinds:
![Page 2: cmosdaq User Guide - University of Oxfordcmosdaq User Guide Luigi Vigani Revision 1 (11/11/2015) Introduction cmosdaq is the software package for managing the interface with the CMOS](https://reader033.vdocument.in/reader033/viewer/2022042219/5ec5b28874b3aa2b4907d625/html5/thumbnails/2.jpg)
o With a SAMTEC connection socket parallel to the board
o With a SAMTEC connection socket perpendicular to the board
Parallel Perpendicular
Daughterboard, inserted in the SAMTEC connector on the Motherboard.
Note that this set-up is very similar to the HVStripV1 one, with the exception that on the latter the
Daughterboard is glued on the Motherboard.
Atlys configuration
To use the Atlys, one must load a firmware on it. The firmware for Chess boards can be found at.
http://www.hep.ucl.ac.uk/~warren/upgrade/firmware/?C=M;O=D
under the name of atlys_itsdaq_va09b_CHS1.bit.
To configure the Atlys you need to download the Digilent Adept software:
http://digilentinc.com/Products/Detail.cfm?NavPath=2,66,828&Prod=ADEPT2
Then follow these steps:
Connect the Atlys board to the computer via the micro-USB cable to the PROG micro-USB socket.
When Windows recognises the board then launch the Digilent Adept software. Ensure that
jumper JP11 on the Atlys board is disconnected (this makes the FPGA use the image stored in the
Flash memory). The ATLYS software should now be able to see the board.
To programme the firmware onto the Atlys board durably (recommended), click the “Flash” tab,
then browse to select the .bit file, then click Program. Durably means that the image goes into the
Flash memory and will survive powering down the board.
To programme the firmware onto the Atlys board temporarily for testing, click the “Config” tab,
then browse to select the .bit file, then click Program. Temporarily means that the image goes
into the FPGA directly, instead of the Flash memory and will not survive powering down the board.
![Page 3: cmosdaq User Guide - University of Oxfordcmosdaq User Guide Luigi Vigani Revision 1 (11/11/2015) Introduction cmosdaq is the software package for managing the interface with the CMOS](https://reader033.vdocument.in/reader033/viewer/2022042219/5ec5b28874b3aa2b4907d625/html5/thumbnails/3.jpg)
For durable programming. For temporary programming.
Software versions
The software for running the chips is provided in 3 versions:
User version: consisting only of an executable program, named Inkler, and the dynamic library
files to run it.
Developer version: Inkler.exe and all the headers and sources file to modify it.
Custom version: this is used in the same fashion as sctdaq: it consists of a dynamic library file,
cmosdaq.dll, that can be loaded with a ROOT macro.
Software installation
The installation for the first two versions is easy. Just download the zip file with the version you want to
use, unzip it in the main folder C: and it should work. The executable is in cmosdaq/Inkler subfolder. If the
computer is 64-bit it can work even without Wireshark (its installation is still recommended). If not, you
must download Wireshark, since the dynamic library file wpcap.dll provided is a 64-bit version. In this case
you can delete this file from the Inkler folder (C:/cmosdaq/Inkler). The Developer Version will have all the
files needed by Visual Studio.
Possible complications:
The .NET framework is an older version: this is related to some Windows library that must be at
least a certain version. In this case when you try to open Inkler it will show an error box reporting
this problem. If you Google the message of the box you will see a page that explains it and provides
a link where you can download the latest version and upgrade your framework. This should solve
the problem.
The installation of the Custom version is different: you need to download the correct version of ROOT for
running it (current version is 5.28.00), which is provided in the link. The root folder can be placed
anywhere, even though it’s easier to put it in C: as well. Then download cmosdaq.dll and the other dll files
needed. Place cmosdaq.dll in C:/cmosdaq/cmosdaqdll and the other dll files in the bin subfolder of root
![Page 4: cmosdaq User Guide - University of Oxfordcmosdaq User Guide Luigi Vigani Revision 1 (11/11/2015) Introduction cmosdaq is the software package for managing the interface with the CMOS](https://reader033.vdocument.in/reader033/viewer/2022042219/5ec5b28874b3aa2b4907d625/html5/thumbnails/4.jpg)
main folder (example C:/root/bin). Then place the two macro files (cmosdaq_init.cpp and
cmosdaq_macro.cpp) in the subfolder macros.
The program will run if you open root.exe and type “.x cmosdaq_init.cpp”.
Possible complications:
Some root dynamic libraries can have problems in loading, leading to errors like “entry point not
found”… This can happen if you have already installed another version of ROOT and its bin
subfolder is registered in your environmental variable PATH: root.exe will try to load first the
libraries in PATH before the one in its folder, and the version may mismatch. To avoid it, just
replace the actual root folder in PATH instead of the one you previously installed, if possible. If
not possible, a valid workaround can be to rename the previous ROOT folder (example, if you had
C:/root_v34.24 you can rename it C:/root_V34.24) and it will skip loading the previous libraries.
How to use it
User Version The idea behind Inkler is to make the software easy to install and use, with an interactive intuitive GUI.
As soon as you open it, there will appear two windows like these:
![Page 5: cmosdaq User Guide - University of Oxfordcmosdaq User Guide Luigi Vigani Revision 1 (11/11/2015) Introduction cmosdaq is the software package for managing the interface with the CMOS](https://reader033.vdocument.in/reader033/viewer/2022042219/5ec5b28874b3aa2b4907d625/html5/thumbnails/5.jpg)
The first one is a console where some debugging lines will be printed on screen, useful to understand
what’s happening. The second is the user interface. In detail:
Session area: not implemented till now. The idea is to record everything that is done each time
you use the program under a session file, and recall it when you need it.
Chip Set-up: connection and general information about the chip.
o Type: specify if you’re using an HVStripV1 or Chess1 (currently the 2 types supported).
Click “Set” when you change it.
o Status: connected or disconnected (through the Atlys board): hit “Connect” to connect to
the Atlys board (once it’s linked with the Ethernet and turned on…).
o Socket address and Atlys IP: these are the parameters necessary for connecting to the
Atlys board. The socket address should be related to the Ethernet port, so you have as
many of them as physical ports on your computer. If you have more than one then you
have to guess what’s the right one depending if you can connect or not. The IP is the
address used to reference to the Atlys board. It is generally fixed to the default one, but
you can change it by changing the switches on the Atlys: recalling the Atlys picture of page
1, the 8 switches on the Atlys correspond to the last 8 bits of the Atlys board. For example,
if you pull up the last switch, then your Atlys address should be e0:dd:cc:bb:aa:01, if you
pull up the last two it must be e0:dd:cc:bb:aa:03 and so on… This may be helpful if you
want to control more boards at the same time: you could give them different addresses
and connect them through an Ethernet switch. In this case you need one instantiation of
Inkler for each board.
o ID (name and number): used when saving data. See the issues in data saving.
o DAC settings: set the DACs. The “Load” button is not implemented (another feature under
implementation is the possibility to save each DAC setting in a specific file possibly HTML,
and recall it later). The “Manual” button will open a window that allow you to set the DAC
(see below). This is different obviously for HVStripV1 and Chess1.
Working Conditions and Device Conditions: while saving data. See the issues in data saving.
Operations: these tabs have the buttons and the controls to perform some basic tasks with these
chips, i.e. setting some output channels, injecting and sampling.
Basic:
o Setup Injection: set one channel to be the output channel for analogue or digital injection.
Digital injection is possible only for HVStripV1.
o Chess1 Specific: Chess1 has multiple read-outs. There is a total of 10 output sockets to be
connected to the 79 Active Pixel Arrays channels on the chip. See Excel document
“CHESS1_motherboard-daughterboard_interface_specs”. To make some of the
operations easier, specific windows can be open. They will be available only if you choose
Chess1 as chip type. In particular:
![Page 6: cmosdaq User Guide - University of Oxfordcmosdaq User Guide Luigi Vigani Revision 1 (11/11/2015) Introduction cmosdaq is the software package for managing the interface with the CMOS](https://reader033.vdocument.in/reader033/viewer/2022042219/5ec5b28874b3aa2b4907d625/html5/thumbnails/6.jpg)
“General Output Control” will pop-up a window where you can set which channel
to connect with which socket
Hit “Set” to write this connections on the motherboard or “Clear” to make all the
connections to “None”, but without writing them.
“Set Chip DACs” will show another window where you can set the DACs easier
than in DAC Settings -> Manual.
You can chose whether to set all to the same value or one by one.
The other ones were used for testing and debugging and have no interest, they
are going to be removed.
Injection and Sample need a scope to collect the waves and are quite delicate to handle. To use
them, I must open up a discussion about pairing with a scope and saving data.
Issues in Data Saving Since the chip we are using till now have been inspected through their analogue output, the data taking
must be performed with a scope. It proved to be useful to pair the chip-setting program with the scope,
as one may speed up the data taking by simply build a routine where in each iteration the chip is set with
a certain value of some parameters (output channel, a given DAC,…), and the data are taken with a specific
file name for that parameter. This way you’ll end up having one file for each set of parameters that you
can compare with the others. Essentially, all the parameters can come from the GUI, and the program
must connect to the scope, tell it to run with a specific trigger setting and collect a given number of waves
with a given threshold.
Since we (in Oxford) have been using till now an Agilent scope connected with USB, we have been
performed this through executable files written with Labview. Now we have moved to a Lecroy scope with
Windows integrated, so that we can use Inkler directly on the scope and try and integrate the read-out. It
is quite a big discussion, and I would open it only if people are really interested in making a common
reference frame for handling it. In case you want to merge chip setting and data taking his own way, you
can use the Custom version of the program.
![Page 7: cmosdaq User Guide - University of Oxfordcmosdaq User Guide Luigi Vigani Revision 1 (11/11/2015) Introduction cmosdaq is the software package for managing the interface with the CMOS](https://reader033.vdocument.in/reader033/viewer/2022042219/5ec5b28874b3aa2b4907d625/html5/thumbnails/7.jpg)
Developer Version If you want to help developing Inkler so as to have a common reference frame, you always welcome. Just
contact me: [email protected]
The program has been written with Visual Studio 2015 Community Version, the latest free open-source
version of Visual Studio. To install it follow the link
https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx
Custom Version Once you opened the ROOT shell try “.x cmosdaq_init.cpp” and verify it tries to connect to the chip. You
should see something like this:
“Didn’t receive ack for register value” means you are not connected to the Atlys. The point is that you
have to define the PCAP address and the Atlys IP address. Those are set in the .cpp file in the line
packet->initReadOut("{XXX}", "e0:dd:cc:bb:aa:00");
where “{XXX}” is your Socket (or PCAP) address (different for each computer): see the explanation in User
Version -> Chip Set-up -> Socket Address and Atlys IP. "e0:dd:cc:bb:aa:00" is the IP address and it can be
chosen the same way it is explained in the User Version.
The socket address to be used can be obtained by looking at Wireshark or at the ROOT window itself: in
fact, before trying to connect, the possible PCAP addresses on your computer are listed. So you must look
in the list on the shell for the Adapter name whose Adapter Description says “Ethernet controller” or
“Network connection” (underlined in blue on the picture – taken from my laptop). To mark some piece of
![Page 8: cmosdaq User Guide - University of Oxfordcmosdaq User Guide Luigi Vigani Revision 1 (11/11/2015) Introduction cmosdaq is the software package for managing the interface with the CMOS](https://reader033.vdocument.in/reader033/viewer/2022042219/5ec5b28874b3aa2b4907d625/html5/thumbnails/8.jpg)
text on ROOT shell just right click the window, then choose Edit->Mark, then when you marked it press
“Enter” and you can paste it on the code itself.
So if you paste the correct socket address and try to do it again you should see no errors (if the Atlys is
turned on and connected with the Ethernet cable).
At this point you are connected to the Atlys. To write on the motherboard, another macro file is provided,
cmosdaq_macro.cpp. You can just load it on root typing “.L cmosdaq_macro.cpp” and you’ll have some
functions specifically conceived for Chess1 chips:
void Chess1_setOutChannel(int ch):
to set one channel only to the read-out (to know what socket it will be connected to, look on the
Excel document “CHESS1 motherboard-daughterboard interface specs 2015-10-15”).
void Chess1_setOutChannels(int ch1, int ch2, int ch3 = -1, int ch4 = -1):
to set up till 4 channels at the same time. If channel is set to -1 it means it is not set at all. It will
also check that you are not setting any two or more channels to the same output socket.
void Chess1_resetOutChannels():
set all output sockets to read out no channels at all.
void Chess1_setDACs(int VPLoad, int Casc, int iNSF, int iN, int iNBias, int iPFB):
set the DAC values. Their integer values represent the DAC voltage in mV, and range from 0 to
3300.
Each function will build up the data stream depending on the given parameters and send it through the
Ethernet. The data stream is in the format of an array of 16-bit variables (unsigned short, redefined as
uint16_t) and it is sent with the method void hsioSendOpcode (uint16_t opcode, uint16_t seqnum, uint16_t length, uint16_t *data)
of the class PacketHandler (packet is an object of that class). To have a more detailed look on it, one can
download the Developer Version.
If you have any question about it, feel free to ask me. If you want to understand how the bit sequence is made up, you may ask me as well, or if you like making it hard you can reverse engineer it yourselves…! Starting from these functions then you can build up your own based on the task you need to perform.