20180826a - Ncycles on 16bits

#!/usr/bin/python
import spidev
import RPi.GPIO as GPIO
import time
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import json
import time
from pyUn0 import *
%matplotlib inline
pyexiv2 does not exist on RPi
x = us_spi()
x.JSON["firmware_version"]="f_un0"
x.JSON["experiment"]["description"]="Testing if the 16bits n cycles works"
x.JSON["experiment"]["probe"]="piezo"
x.JSON["experiment"]["target"] = "a reflector few cms away"
x.JSON["V"]="24"
x.JSON["N"] = 1 # Experiment ID
x.init()                                    # Inits the FPGA

Curve = x.CreateDACCurve(300,900,True)[0]   # Sets the DAC, 50mV to 850mv
pyUn0.py:149: RuntimeWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.
  GPIO.setup(CS_FLASH,GPIO.OUT)


Reset GPIO 23 - Low 1s
Reset GPIO 23 - High 0.2s
spi.cshigh is False
spi mode is 1
spi maxspeed is 2000000hz
Setting up the DAC
x.JSON["N"] = 1
x.setMultiLines(True)                        # Multi lines acquisition    
x.setNLines(500)                            # Setting the number of lines
x.setMsps(7)                                 # Acquisition Freq
A = x.setTimings(200,100,2000,21000,145000)    # Settings the series of pulses
Remember to indicate how many lines
Number of lines: 500
Acquisition frequency set at 8.0 Msps
Pulse width: 200  ns --  0x14
Pulses delay: 300  ns --  0x1e
Poff: 2300  ns --  0x0 0xe6
Delay between: 21000 ns --  0xa 0x80
Acquisition length:  145000 ns --  0x48 0x80
setPulseTrain Lacq 145000
NAcq = 496000
x.JSON["data"] = x.doAcquisition()
x.JSON["N"] = x.JSON["N"] + 1
0%
10%
20%
30%
40%
50%
60%
70%
80%
90%
100%
Took 96.99 seconds to transfer.
for 992002 transfers of data
20180826a-1.json: file saved.


results matching ""

    No results matching ""