20
1 XTD User Manual Instrumentation Development Labs IDL_17_004 – X-Ray Timing Distribution Modules (XTD) Internal Documentation / User Manual Guide Documentation Prepared By Julien. C Email : [email protected] University of Hawaii at Manoa Office # : WAT209 Office Phone # : (808) 956-2941 Updated : 7 / 3 / 2017 1

XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

1 XTD User Manual

Instrumentation Development Labs IDL_17_004 – X-Ray Timing Distribution Modules (XTD) Internal Documentation / User Manual GuideDocumentation Prepared By Julien. C Email : [email protected] of Hawaii at Manoa Office # : WAT209Office Phone # : (808) 956-2941Updated : 7 / 3 / 2017

1

Page 2: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

2 XTD User Manual

Table of Contexts

1. Introduction2. Functional Diagram3. Physical Description

3.1 Physical Dimension3.2 Port

3.2.1 Front 3.2.2 Display 3.2.3 RJ-45 A . CLK/BM A/B

B. JTAG 3.2.4 Back

4 . Electrical Property4.1 Absolute Maximum Rating4.2 Recommended Operating Conditions4.3 JTAG Electrical Characteristic4.4 RF input/Output Electrical Characteristic

5 . Hardware Compatibly (revision required)6. Software Description

6.1 Installation Guide on Raspberry PI 2 6.1.1 Installing OS/Package

6.1.2 Configuration6.2 Running Raspberry Pi 2 Scripts 6.2.1 “defaultdriver.py” – Main Script 6.2.2 “si5338_post.py” – PLL drivers6.3 Optional : Instruction on generating PLL’s Register Map Using

Clock Builder Desktop 6.4 (Requires Window)

7 Testing Set Up8. Calibration9. List of Change Recommended For Future Revision.10. Documentation Correction

Appendix A. Schematic B. Layout C. Part List D. Reference Code

D.1. defaultdriver.pyD.2. pin.pyD.3. Map.txt

E. NIM Crate Solidwork’s ModelE.1 Front Panel

E.2 Back PanelReference

2

Page 3: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

3 XTD User Manual

1 . Introduction X-Ray Timing Distribution are module designed to fan out the input’s Clock/Revolution Marker signals and JTAG signal for application in SuperKEKB Cyclotron’s X-Ray Monitor. It has a SMA RF input which is preset to accept 508.9MHz sinusoidal signal which are fed to the Phase Frequency detectors (PFD) which cleans the signal and correct the phase of the signal. The Bunch Marker are generated using the 2 x 8 bit counter on board to divide the RF input reference clock. The revolution marker are used rest the counters. These Bunch marker signals are program by programming a shift register at the start of the operation by Raspberry pi 2 (Single Board Computer ) Running on raspbian. There is an on-board diligent debugger which is the can be used as the remote JTAG communication using a RJ-45 connectors. It is in a Nuclear Instrumentation Module (NIM) format and the module has a option to be powered by from NIM crates or AC power provided by 3 prong power socket which is toggled by the switch in the back of the modules.

2 . Functional Diagram

3. Physical Description Port

3.1 Front Physical DescriptionInput

RF INPUT (SMA - 509MHz)REV MARKER (LIMO)

OutputJTAG Programmer (RJ-45 x 2)CLK/BM (RJ-45 x 2)TEST SIGNAL (LEMO - 99kHz Pulse 2ns)TEST RF SIGNAL (SMA - 509MHz)

3.2 Display `XTD : Current Input of PLL ; The RF or OBCBMA: Bunchmarker # for the marker A*BMB: Bunchmarker # for the marker B*TEST CIRCUIT: Status of the on-board testing Circuits.JTAG: Select A or Both (Note Currently Not working).IP: Current IP address.

3

Page 4: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

4 XTD User Manual

3.3 RJ-45 ( Front View )

*See section on compatibilities for more information regarding remote JTAG comparability

JTAGDifferential Pairs are listed Below.Port A1 : TDO1_P2 : TDO1_N3 : TDI1_P4 : TMS1_N5 : TMS1_P6 : TDI1_N7 : TCK1_P8 : TCK1_N

Differential Pairs are listed Below.Port B1 : TDO2_P2 : TDO2_N3 : TDI2_P4 : TMS2_N5 : TMS2_P6 : TDI2_N7 : TCK2_P8 : TCK2_N

CLK/BM A/B / RMDifferential Pairs are listed Below.Port A1 : BMB1_P2 : BMB1_N3 : RMOUT1_P4 : BMA1_N5 : BMA1_P6 : RMOUT1_N7 : RFOUT1_P8 : RFOUT1_N

Differential Pairs are listed Below.Port B1 : BMB2_P2 : BMB2_N3 : RMOUT2_P4 : BMA2_N5 : BMA2_P6 : RMOUT2_N7 : RFOUT2_P8 : RFOUT2_N

3.4 Back Physical DescriptionRaspberry Pi 2

USB 2.0 x 4RJ-45 100 mbsp

Micro-USB Digilent Programmer SMT2.Power Switch (NIM PWR / AC PWR)NIM POWER BLOCKA/C Connectors

4

Page 5: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

5 XTD User Manual

4.1 Electrical Property 4.2 Absolute Maximum Rating Parameter Symbol Test Condition Value UnitsAC Supply VAC ECS60US05 Datasheets Reference 80~264 Vac

RF INPUT Voltage VRFINPUT Max Vbr of HSMS-282x Datasheets Reference*

15 V

REV INPUT Voltage VREVIN Max Vbr of HSMS-282x Datasheets Reference*

15 V

Operational Temp Top Max Rated TOp for UHS-I Cards Datasheet

85 °C

*This is Input protection breakdown voltage.

4.3 Typical JTAG / CLK /BM Output Electrical CharacteristicsParameter Test Condition/ Source Vcc T = 22 °C Unit

Min TYP MaxVOH (LVDS) VOY Unloaded Single-ended pin values /

Measured W/ Multimeter3.3V 3.27 Vcc – 0.07 V

VOL (LVDS) Unloaded Single-ended pin values/ Measured W/ Multimeter

3.3V Vee + 0.2 0.2 V

Io = Receiver Output Current

SN65LVDXX Datasheet’s Maximum Output 3.3V -12 12 mA

VOC (LVDS) SN65LVDXX Datasheet’s Average output 3.3V 1.2 V

Tpdt (TDO) SN65LVDS2 & SN74AUP1T157DCKR Datasheet

3.3V 4.2 ns

Tpdt (TDI, TMS, TCK) SN65LVDS1 & SN74LVC2G34DCKRDatasheet

3.3V 2.5 7.2 ns

Tpdt (CLK) Si5338 Datasheet 3.3V 2.5 4 ns

Tpdt (BM) 3.3V ns

Source : http://www.ti.com/lit/ds/symlink/sn65lvds1.pdf Source : http://www.ti.com/lit/ds/symlink/sn65lvds1. pdf

4.4 Typical RF Input / output Electrical CharacteristicsParameter Test Condition/ Source Vcc T = 22 °C Unit

Min TYP MaxVpp RFIN Value used during testing 500 - 700 mV

fop Si5338’s Differential Input range values 5 508.9 710 MHz

Rin Design Parameter 50 Ω

5

Page 6: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

6 XTD User Manual

5.1 Hardware CompatiblyThis are listed are hardware compatibility device. This was determined by examine the schematic/layout to determine the pin compatibility for each functionality to the device. (Updated : 2017-06-06 : NOTE : there is a currently know issue with the LVDS portion of the line that make impossible to communication. For more information, please read the IDLAB XTD’s JTAG Debugging Note 2.) This can be programmed thru the external Diglient programmer or on-board

Remote Programming Application (JTAG operation) : STRAP Board Rev A (Not been Tested) : No RJ-45 or functional JTAG: NOSCROD Rev B2 – IDL_15_007 (Not Been tested) : With TJ Hooker Rev A : Cable - Straight Thru RJ-45 Style : YESSCROD Rev B – IDL_14_002 (Not Been Tested) : No RJ-45, Only Physically Solder wire : NOSCROD Rev A5 – IDfL_15_002 (Not Been Tested) : Requires a Custom Cable wiring scheme shown below*: PROBABLESCROD Rev A4 – IDL_15_002 (Not Been Tested) : Requires a Custom Cable wiring scheme shown below*: PROBABLESCROD Rev A3 – IDL_13_037 (Tested Confirmed to be able to program using IMPACT and openocd): Requires a Custom Cable wiring scheme shown below*: PROBABLE

Custom Cable Scheme for Remote JTAG (Note : Only use this when SCROD version A )Pin # 1 2 3 4 5 6 7 8XTD Side wO O wG B wB G wBr BrSCROD Side Br wBr wB G wG B wO O

*Even if with the custom cable, Current version has some issue using the onboard JTAG. This has been only tested with the first generation.

Clock distribution Application (CLK/BM Operation) : SCROD Rev B2 – IDL_15_007 (Not Been tested) : With TJ Hooker Rev A : YESSCROD Rev A3 - IDL_13_037 (Not Been tested) : RJ-45 Custom Cable

6.1 Software DescriptionMost of the software will be preinstalled on the XTD RPI. However, if there is memory correction on the MicroSD, here are the instruction on reinstalling them.

6.2 Installing OS/Package Installation Guide on Raspberry PI 2First you would need to install the raspbian os in a flash drive. Then we will need to install the necessary package from the terminal by accessing them thru SSH.

6.2.1 Installation Raspbian on MicroSD with Window 10 **There are plenty of installation procedures available online: Google is your friend, If something doesn’t work please use a common sense.

(Still needs work/ Screenshot)

6.2.2 Installation with on MicroSD with Linux (Not been tested)**There are plenty of installation procedures available online: Google is your friend, If something doesn’t work please use a common sense. Source : https://cmanios.wordpress.com/2013/03/10/install-raspbian-wheezy-linux-to-raspberry-pi-using-linux/

The instruction is the following, using a MicroSD card, First, we need to determine which the mounted directory. To do this, we will run the df below the example df

linux@ubuntu:~$ dfFilesystem 1K-blocks Used Available Use% Mounted on/dev/loop0 25948028 13156440 11473496 54% /

6

Page 7: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

7 XTD User Manual

udev 1018844 4 1018840 1% /devtmpfs 410444 872 409572 1% /runnone 5120 0 5120 0% /run/lock/dev/sda6 42074200 35229872 6844328 84% /hostnone 1026108 0 1026108 0% /run/shm/dev/mmcblk0 1946896 4 1946892 1% /media/mysdcard

umount /media/mysdcard

to creating the disk partition on the MicroSD card.

sudo mkdosfs -F 32 -v /dev/mmcblk0

sudo dd bs=1M if="/home/linux/2013-02-09-wheezy-raspbian.img" of=/dev/mmcblk0

Now you have working OS image on the MicroSD card.

Installing the Necessary Package.There are few package in order to get the current patched version from github repository. First it is recommended to update all of the current package installed on the current Operating System (OS). To update the current application. Run this following commend.

sudo apt-get update & upgrade

After the update, then if not installed, install git on the current file.

sudo apt-get install git

ConfigurationSo the link you would need to clone the directry from the github account, So first go to your home directory.

cd ~

So now that you are on the home directory, we need to make a directory for the XTD.

mkdir XTD

Run this command line below to clone the remote directory on the github account to the local directory.

sudo git clone https://github.com/Adrastus123/XTD.git

Once the files been uploaded on to your local directory, then proceeds to the changing the directory on to the “XTD” directory using cd command and opening the sub directory called “maindriver”. Once that is done, you are now ready to run the directory form. Check if the

Running Raspberry Pi 2 Scripts“defaultdriver.py” – Main ScriptThis is a general file to run the functionality of the XTD. The command to do this is following

Example 1 : Running the Main Script.sudo python ./defaultdriver.py

“si5338_POST.py” – PLL drivers

This is the general drivers for the PLL. It is written in python. When init function will write to i2c registry automatically need to program. There is also function is program function that will be used by the defaultdriver to program all registry mapping from the clock builder 6.4 from silab. The function will look for the registry mapping generated by the clockbuilder 6.4* and the file must be named “map.txt” in the current working

7

Page 8: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

8 XTD User Manual

directory. If this does not exist, then this function will result in error. If you clone from the github. This file should be included. However, if you would like to change any of the output

To understand what is happening in the PLL here is the functional diagram below

*see optional section for instruction to running to clockbuilder 6.4

Example 1 : Implementation in XTD’s si5338_POST.py Python Scripts for Programming Device.)

from si5338POST_Test import *from userSettings import * from REGS import *from smbus import SMBusfrom RPi.GPIO as GPIO

REGMAP = “map.txt”Bus = SMBus(1)user = userSetting()user.osc = bool(int(osc))

pll = si5338POST(0x70, user.osc, bus,VCOREGS, PINS[“Interrupts”], GPIO)pll.program(REGMAP)

Optional: Instruction on generating PLL’s Register Map Using C1lock Builder Desktop 6.4 (Requires Window)The clockbuilder 6.4 can be downloaded from this link above.

Link: http://www.silabs.com/documents/login/software/ClockBuilderDesktopSwInstall.zip

You might need to register to download them, but alternatively inside the XTD REV B box there should be a CD with necessary software.

After installing, the you need start the program. Once the program starts, the Device and EVB pop up window opens

8

Page 9: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

9 XTD User Manual

Once it opens up, the if you are using the XTD rev B, then you should select SI5338 and select “Do not connect the EVB” then click ok.

The “frequency plan” tab shows access to select the input frequency, the PFD output for each output. There is a two option that is available on the XTD; Onboard Clock and Rf input. The IN1, IN2 are connected to 127.15Mhz on-board clock for testing purposes, and the IN5, IN6 are the RF input coming from SMA connectors. For the current setting the here is the current setting

INPUT CONFIGURATION = Differential ON IN1 & IN2 (5 – 710MHz) INPUT FREQUENCY (MHZ) = 508.9MHz

9

SI5338’s wiring diagram

SI5338’s Input/output Configuration

Page 10: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

10 XTD User Manual

OUTPUT FREUQNCIES (MHZ) = Add CLK0 : 127.15MHz, CLK1 : 127.15MHz, and CLK2 : 127.15MHz

For the Next tab shows Output Drivers for each clock fan out for the PLL.

Currently the register needs to be programmed in this configuration for the current operation.

CLK0A/B – ON – LVDS3.3V - CLK0 stopped low when output disable - No inversion CLK1A/B – ON – LVDS3.3V - CLK1 stopped low when output disable - No inversion CLK2A/B – ON – LVDS3.3V - CLK2 stopped low when output disable - No inversion

The Next tab of interest are the “status” tab which when connected using the EVB, it will display the current status of the chips and the configuration of the masking status. Currently, all the current status to be working order then must have none of the status be masked.

Note that under interrupt mask (Register 6 ) is all unchecked.

Testing Set UpIf you would like to know how all of the functionality were tested please read the application note for more information.

Link :

10

SI5338’s Output Driver Configuration

Page 11: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

11 XTD User Manual

CalibrationIf you would like know more regarding now to calibration the bench maker and the rev marker please read the application note for more information.

Link :

Warning, most of the system are already calibrated to accept the revolution markers so be ca

List of Change Recommended For Future Revision.1. Remove the testing circuit. It’s was unnecessary and mostly unused.2. Add additional output for JTAG/ CLK/TRIG.3. Replace the display with cheaper LCD modules. Current modules are bit pricy. Something like this and run a link :

https://www.alibaba.com/product-detail/1-5-inch-oled-micro-display_60252120151.html?spm=a2700.7724838/new.2017115.95.lrrFXy

4. Diligent smt2 are currently not working properly, I would recommend adding buffer closer to the smt2 or bring the module closer. 5. Raspberry Pi 2 worked well, but we can make them as raspberry pi zero will save on the total cost.

Appendix A. Schematic See Altium Files Link : http://www.phys.hawaii.edu/~idlab/taskAndSchedule/PCBs/XTD/revB/IDL_17_004.zip

B. PCBSee Altium Files Link : http://www.phys.hawaii.edu/~idlab/taskAndSchedule/PCBs/XTD/revB/IDL_17_004.zip

C.IC Part List Name Datasheet Link

1 SN65LVDS1 http://www.ti.com/lit/ds/symlink/sn65lvds1.pdf

2 SN65LVDS2 http://www.ti.com/lit/ds/symlink/sn65lvds1pdf

3 HSMS-2822 https://docs.broadcom.com/docs/AV02-1320EN

4 ADCLK925BCPZ(Sine-LVPECL) http://www.analog.com/media/en/technical-documentation/data-sheets/ADCLK905_907_925.pdf

5 SI5338A-B-GM(PLL) http://www.silabs.com/documents/public/data-sheets/Si5338.pdf

6 LT1945 http://cds.linear.com/docs/en/datasheet/1945fa.pdf

7 MAX9601EUP (NIM-LVPECL) http://datasheets.maximintegrated.com/en/ds/MAX9600-MAX9602.pdf

8 85411AMILF(1:2 FANOUT LVPECL-LVDS) http://www.idt.com/document/dst/85411i-datasheet

9 74HC590PW(8 bit Counter) https://assets.nexperia.com/documents/data-sheet/74HC590.pdf

10 LT1395C55(OPAMP) http://cds.linear.com/docs/en/datasheet/139567fd.pdf

11 74HC682DW(2x8 COM) http://www.ti.com/lit/ds/symlink/sn74hc682.pdf

12 MC100LVEL29-D(DOUBLE DFF) http://www.onsemi.com/pub/Collateral/MC100LVEL29-D.PDF

13 SY89845UMG (1-4 LVPECL-LVPECL) http://ww1.microchip.com/downloads/en/DeviceDoc/sy89845u.pdf

14 55855VKG (LVPECL-LVDS) http://ww1.microchip.com/downloads/en/DeviceDoc/sy55855v.pdf

15 MC100EP016A(8_Bit_Counter) https://www.onsemi.com/pub/Collateral/MC100EP016A-D.PDF

16 SY58032UMG (1-8 Fanout) http://ww1.microchip.com/downloads/en/DeviceDoc/sy58032u.pdf

17 SN74LV594APWR (Shift Regisiter) http://www.ti.com/lit/ds/symlink/sn74lv594a.pdf

18 CVCO55CL-0490-0540 (VCO) http://www.crystek.com/microwave/admin/webapps/welcome/files/vco/CVCO55CL-0490-0540.pdf

19 SN74LVC2G34DCKR http://www.ti.com/lit/ds/symlink/sn74lvc2g34.pdf

20

11

Page 12: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

12 XTD User Manual

D. Reference Code D.1 defaultdriver.pyfrom userSettings import *import RPi.GPIO as GPIOfrom smbus import SMBusfrom si5338POST import *from REGS import *from PINS import *from bunchMarker import *import timeimport seps525from text import Text_string as TSimport csvfrom font import Fontimport spidevfrom getIP import *import os

# Default Valuesosc = 0 # 0 = RFin; 1 = osctestSignal = 1 # 0 = off; 1 = onjtag = 1 # 1 = SCROD A; 0 = SCROD A+Bbma = 501bmb = 499REGMAP = "map.txt"

GPIO.cleanup()

GPIO.setmode(GPIO.BCM)GPIO.setup(PINS["TESTEN"], GPIO.OUT)GPIO.setup(PINS["JTAGSEL"], GPIO.OUT)GPIO.setup(PINS["SHUTDOWN"], GPIO.IN)GPIO.output(PINS["TESTEN"], True)

bus = SMBus(1)#user interactive components are commented out for default driveruser = userSettings()

user.osc = bool(int(osc))print bcolors.WARNING + "Loading PLL" + bcolors.ENDC

pll = si5338POST(0x70, user.osc, bus, VCOREGS, PINS["INTERRUPT"], GPIO)pll.program(REGMAP)# Debugging Purposes : programs from clockbuilder reg map#pll.regcheck(REGMAP)# Debugging Purposes : compares the resulting programmed with the file.

try: if pll.check(): print bcolors.FAIL + "Exiting..." + bcolors.ENDC else: print bcolors.OKGREEN + "PLL Ready" + bcolors.ENDCexcept Exception, e: import csv with open("log.txt", "a") as logFile: csvW = csv.writer(logFile) row = [str(e)] csvW.writerow(row) time.sleep(30) if pll.check(): print "PLL Check True" pass else: pass

bus.close()

user.testSignal = bool(int(testSignal))user.jtag = bool(int(jtag))

if bool(user.testSignal) == True: print bcolors.OKGREEN + "Test Signal ON" + bcolors.ENDC GPIO.output(PINS["TESTEN"], True)else: print bcolors.OKGREEN + "Test Signal OFF" + bcolors.ENDC GPIO.output(PINS["TESTEN"], False)

if user.jtag == True: print bcolors.OKGREEN + "JTAG A SELECTED" + bcolors.ENDC GPIO.output(PINS["JTAGSEL"], True)else: print bcolors.OKGREEN + "JTAG A&B SELECTED" + bcolors.ENDC GPIO.output(PINS["JTAGSEL"], False)

user.bunchMarkerA = int(bma)user.bunchMarkerB = int(bmb)

BMA = bunchMarker(PINS["BMASRCLK"], PINS["BMARCLK"], PINS["SRA"], GPIO)BMB = bunchMarker(PINS["BMBSRCLK"], PINS["BMBRCLK"], PINS["SRB"], GPIO)

BMA.reset()BMB.reset()

BMA.bunchMarker(user.bunchMarkerA)BMB.bunchMarker(user.bunchMarkerB)

# Initialize Fontsfont14h = Font("font14h")font14h.init_bitmap("font14h.csv")font14hL = Font("font14hL.csv")font14hL.init_bitmap("font14hL.csv")

# Initialize Display

# Set Label StringsinputTitle = "XTD:"bmaTitle = "BMA:"bmbTitle = "BMB:"testCircuit = "TEST CIRCUIT:"pllTitle = "PLL:"jtagTitle = "JTAG:"IPTitle = "IP:"IPValue = getIP()

# Set Label ValuesinputValue = ""if user.osc == 0: inputValue = "RF"else: inputValue = "OSC"bmaValue = str(user.bunchMarkerA)bmbValue = str(user.bunchMarkerB)testCircuitValue = ""if user.testSignal == True: testCircuitValue = "ON"else: testCircuitValue = "OFF"pllValue = "LOCKED"jtagValue = ""if user.jtag == True: jtagValue = "A"else: jtagValue = "AB"

try: display = seps525.SEPS525_nhd(DC = PINS["DISPDC"], RES = PINS["DISPRES"], gpio = GPIO) display.fill_screen((255,255)) while(True): # Draw Labels loffset = 10 inputDisp = TS(loffset, 10, 14, inputTitle, font14h) bmaDisp = TS(loffset, 26, 14, bmaTitle, font14h) bmbDisp = TS(loffset, 42, 14, bmbTitle, font14h) testCircuitDisp = TS(loffset, 58, 14, testCircuit, font14h) pllDisp = TS(loffset, 74, 14, pllTitle, font14h) jtagDisp = TS(loffset, 90, 14, jtagTitle, font14h) IPDisp = TS(loffset, 106, 14, IPTitle, font14h)

inputDisp.draw_string((0, 0), (255, 255), display) bmaDisp.draw_string((0, 0), (255, 255), display) bmbDisp.draw_string((0, 0), (255, 255), display) testCircuitDisp.draw_string((0, 0), (255, 255), display) pllDisp.draw_string((0, 0), (255, 255), display) jtagDisp.draw_string((0, 0), (255, 255), display) IPDisp.draw_string((0, 0), (255, 255), display)

# Draw Values loffset = 20 inputValueDisp = TS(loffset + len(inputDisp), 10, 14, inputValue, font14h) bmaValueDisp = TS(loffset + len(bmaDisp), 26, 14, bmaValue, font14h) bmbValueDisp = TS(loffset + len(bmbDisp), 42, 14, bmbValue, font14h) testCircuitValueDisp = TS(loffset + len(testCircuitDisp), 58, 14, testCircuitValue, font14h) pllValueDisp = TS(loffset + len(pllDisp), 74, 14, pllValue, font14h) jtagValueDisp = TS(loffset + len(jtagDisp), 90, 14, jtagValue, font14h) IPValueDisp = TS(loffset + len(IPDisp), 106, 14, IPValue, font14h)

inputValueDisp.draw_string((0, 0), (255, 255), display) bmaValueDisp.draw_string((0, 0), (255, 255), display) bmbValueDisp.draw_string((0, 0), (255, 255), display) testCircuitValueDisp.draw_string((0, 0), (255, 255), display) pllValueDisp.draw_string((0, 0), (255, 255), display) jtagValueDisp.draw_string((0, 0), (255, 255), display) IPValueDisp.draw_string((0, 0), (255, 255), display)

IPValue = getIP()

if pll.check(): pllValue="NOT LOCKED!" else: pllValue="LOCKED "

if GPIO.input(PINS["SHUTDOWN"]) == False: # depends polarity of shutdown button break;

except Exception, e: import csv with open("log.txt", "a") as logFile: csvW = csv.writer(logFile) row = [str(e)] csvW.writerow(row)loffset = 10display.fill_screen((255, 255))shutdownDisp = TS(loffset, 26, 14, "Shutting Down", font14h)descDisp1 = TS(loffset, 42, 14, "Wait for Screen", font14h)descDisp2 = TS(loffset, 74, 14, "to Disappear", font14h)

shutdownDisp.draw_string((0, 0), (255, 255), display)descDisp1.draw_string((0, 0), (255, 255), display)descDisp2.draw_string((0, 0), (255, 255), display)#os.system("shutdown -h now")#For debugging prepose, removed.os.system("shutdown -r now")

12

Page 13: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

13 XTD User Manual

D.2 pin.pyPINS = { "JTAGSEL" : 13, "TESTEN" : 21, "INTERRUPT" : 9, "TMS" : 14, "TDO" : 15, "TDI" : 18, "BMBSRCLK" : 22, "BMARCLK" : 27, "BMASRCLK" : 17, "TCK" : 4, "BMBRCLK" : 24, "SRA" : 23, "SRB" : 25, "SHUTDOWN" : 7, "DISPRES" : 6, "DISPDC" : 20,}

D.3 Reg.pyVCOREGS = { "ENOUTS" : 230, "PLLWPASS" : 6, "PFDDIV" : 29, "PFDFB" : 30, "MSNP1S1" : 97, "MSNP1S2" : 98, "MSNP1S3" : 99, "MSNP2S2" : 100, "MSNP2S3" : 101, "MSNP2S4" : 102, "MSNP3S1" : 103, "MSNP3S2" : 104, "MSNP3S3" : 105, "MSNP3S4" : 106,}

D.4 font.pyimport osimport csvclass Font: # LIBRARIES

"""Reads a font from a csv bitmap.

""" def __init__(self, name, spacer = 2): self._name = name self.FONT = {} self._spacer = "" for i in range(spacer): self._spacer += "0"

def __str__(self): characters = "" for char in self.FONT: characters += char return characters

def init_bitmap(self, input_file):""" Initialize the bitmap from csv file. The csv row should consist of name, string of 1's and

0's(of width). Use fontparser.py to get the .csv."""

script_path = os.path.dirname(os.path.realpath(__file__)) input_file_path = os.path.join(script_path, input_file) with open(input_file_path, "rb") as bitmap_file: reader = csv.reader(bitmap_file) for row in reader: if row[0] not in self.FONT.keys(): self.FONT[str(row[0])] = [] self.FONT[str(row[0])].append(row[1] + self._spacer) else:self.FONT[str(row[0])].append(row[1] + self._spacer)

D.5 getIP.py#!/usr/bin/env python

import osimport csv

def getIP(): try: os.system("ifconfig eth0 > IPADDRESS.txt") line = []

with open("IPADDRESS.txt", "rb") as IP: csvReader = csv.reader(IP) for row in csvReader: if row != []: if "inet addr:" in row[0]: line = row[0]

line = line.split("inet addr:") return line[1].split()[0] except:return "No IP

13

Page 14: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

14 XTD User Manual

D.6 map.txt (1/5) 2/5 3/5 4/5 5/5#Do not send this file to Silicon Labs. Use custom part menu option instead.#This file is not valid for NVM generation.#Do not modify the contents of this file.#BEGIN_PROFILE#Date = Tuesday, May 30, 2017 10:41:40 PM#Profile = 1#Software version = 6.4 - October 8, 2014#File version = 3#Chip = Si5338#Input Frequency (MHz) = 509.000000000#Input Type = LVDS_LVPECL_HCSL#P1 = 16#Input Mux = DivFbClk#FDBK Input Frequency (MHz) = 509.000000000#FDBK Input Type = LVDS_LVPECL_HCSL#P2 = 16#FDBK Mux = NoClk#PFD Input Frequency (MHz) = 31.812500000#VCO Frequency (GHz) = 2.545000#N = 80 (80.0000)#Internal feedback enabled#Output Clock 0# Output Frequency (MHz) = 127.250000000# Mux Selection = IDn# MultiSynth = 20 (20.0000)# R = 1#Output Clock 1# Output Frequency (MHz) = 127.250000000# Mux Selection = IDn# MultiSynth = 20 (20.0000)# R = 1#Output Clock 2# Output Frequency (MHz) = 127.250000000# Mux Selection = IDn# MultiSynth = 20 (20.0000)# R = 1#Output Clock 3# Output is off#Driver 0# Enabled# Powered on# Output voltage = 3.30# Output type = 3.3V LVDS# Output state when disabled = StopLow#Driver 1# Enabled# Powered on# Output voltage = 3.30# Output type = 3.3V LVDS# Output state when disabled = StopLow#Driver 2# Enabled# Powered on# Output voltage = 3.30# Output type = 3.3V LVPECL# Output state when disabled = StopLow#Driver 3# Disabled# Powered off# Output voltage = 3.30# Output type = 3.3V LVDS# Output state when disabled = StopLow#Frequency and phase adjust 0# Initial phase offset (ns) = 0.000# Phase step size (ns) = 0.000# Frequency adjust is off#Frequency and phase adjust 1# Initial phase offset (ns) = 0.000# Phase step size (ns) = 0.000# Frequency adjust is off#Frequency and phase adjust 2# Initial phase offset (ns) = 0.000# Phase step size (ns) = 0.000# Frequency adjust is off#Frequency and phase adjust 3# Frequency and phase increment and decrement is off#Spread spectrum 0# Spread spectrum is off#Spread spectrum 1# Spread spectrum is off#Spread spectrum 2# Spread spectrum is off#Spread spectrum 3# Spread spectrum is off#REGISTER_MAP 0,00h

1,00h 2,00h 3,00h 4,00h 5,00h 6,04h 7,00h 8,70h 9,0Fh 10,00h 11,00h 12,00h 13,00h 14,00h 15,00h 16,00h 17,00h 18,00h 19,00h 20,00h 21,00h 22,00h 23,00h 24,00h 25,00h 26,00h 27,70h 28,03h 29,64h 30,A4h 31,C0h 32,C0h 33,C0h 34,E3h 35,00h 36,06h 37,06h 38,04h 39,00h 40,63h 41,3Ch 42,23h 43,00h 44,00h 45,00h 46,00h 47,14h 48,2Ch 49,00h 50,C4h 51,07h 52,10h 53,00h 54,08h 55,00h 56,00h 57,00h 58,00h 59,01h 60,00h 61,00h 62,00h 63,10h 64,00h 65,08h 66,00h 67,00h 68,00h 69,00h 70,01h 71,00h 72,00h 73,00h 74,10h 75,00h 76,08h 77,00h 78,00h 79,00h 80,00h 81,01h 82,00h 83,00h 84,00h 85,10h 86,00h 87,00h 88,00h

89,00h 90,00h 91,00h 92,00h 93,00h 94,00h 95,00h 96,10h 97,00h 98,26h 99,00h100,00h101,00h102,00h103,01h104,00h105,00h106,80h107,00h108,00h109,00h110,40h111,00h112,00h113,00h114,40h115,00h116,80h117,00h118,40h119,00h120,00h121,00h122,40h123,00h124,00h125,00h126,00h127,00h128,00h129,00h130,00h131,00h132,00h133,00h134,00h135,00h136,00h137,00h138,00h139,00h140,00h141,00h142,00h143,00h144,00h145,00h146,FFh147,00h148,00h149,00h150,00h151,00h152,00h153,00h154,00h155,00h156,00h157,00h158,00h159,00h160,00h161,00h162,00h163,00h164,00h165,00h166,00h167,00h168,00h169,00h170,00h171,00h172,00h173,00h174,00h175,00h176,00h

177,00h178,00h179,00h180,00h181,00h182,00h183,00h184,00h185,00h186,00h187,00h188,00h189,00h190,00h191,00h192,00h193,00h194,00h195,00h196,00h197,00h198,00h199,00h200,00h201,00h202,00h203,00h204,00h205,00h206,00h207,00h208,00h209,00h210,00h211,00h212,00h213,00h214,00h215,00h216,00h217,00h218,00h219,00h220,00h221,0Dh222,00h223,00h224,F4h225,F0h226,00h227,00h228,00h229,00h230,08h231,00h232,00h233,00h234,00h235,00h236,00h237,00h238,14h239,00h240,00h242,00h243,F0h244,00h245,00h247,00h248,00h249,A8h250,00h251,84h252,00h253,00h254,00h255,00h256,00h257,00h258,00h259,00h260,00h261,00h262,00h263,00h264,00h265,00h266,00h

267,00h268,00h269,00h270,00h271,00h272,00h273,01h274,00h275,00h276,90h277,31h278,00h279,00h280,01h281,00h282,00h283,00h284,00h285,00h286,00h287,00h288,00h289,01h290,00h291,00h292,90h293,31h294,00h295,00h296,01h297,00h298,00h299,00h300,00h301,00h302,00h303,00h304,00h305,01h306,00h307,00h308,90h309,31h310,00h311,00h312,01h313,00h314,00h315,00h316,00h317,00h318,00h319,00h320,00h321,01h322,00h323,00h324,90h325,31h326,00h327,00h328,01h329,00h330,00h331,00h332,00h333,00h334,00h335,00h336,00h337,00h338,00h339,00h340,90h341,31h342,00h343,00h344,01h345,00h346,00h347,00h348,00h349,00h350,00h#END_PROFILE

14

Page 15: XTD Rev B User Manual - University of Hawaiʻiidlab/JulienC/XRM/User... · Web viewInstallation Guide on Raspberry PI 2 First you would need to install the raspbian os in a flash

15 XTD User Manual

15