From ea53c390f7c9b34d62fff49b92949a8a8c8b4e70 Mon Sep 17 00:00:00 2001 From: Dan White Date: Sun, 6 May 2012 12:02:42 -0500 Subject: [PATCH] WIP --- python-lib/mpsse-test.py | 25 ++++++++++++++++++++----- python-lib/usbio.py | 6 ++++-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/python-lib/mpsse-test.py b/python-lib/mpsse-test.py index e7335fd..308eecd 100755 --- a/python-lib/mpsse-test.py +++ b/python-lib/mpsse-test.py @@ -12,6 +12,7 @@ import usbio do_shell = True +#do_shell = False @@ -35,10 +36,14 @@ def cfg2hexstr(x): ############################################################################## # Setup FTDI serial ports # -spi0 = usbio.AtoiSPI0(1000e3) #port A -spi1 = usbio.AtoiSPI1(500e3) #port B +spi0 = usbio.AtoiSPI0(100e3) #port A + +spi1 = usbio.AtoiSPI1(100e3) #port B +spi1.context.pidle = spi1.context.pstop = 0xf8 +spi1.Stop() + i2c = usbio.I2C(interface=usbio.ftdi.INTERFACE_C, scl=0, sda=1, - vid=0x0403, pid=0x6011, delay=10e-6) + vid=0x0403, pid=0x6011, delay=100e-6) ############################################################################## @@ -139,7 +144,7 @@ for h in chain.h: ota.fast = 1 ota.gain = 8 ota.offset = 0 -chain.write() +#chain.write() mux.selA = 48 mux.selB = 48 @@ -148,7 +153,7 @@ for ota in mux.ota: ota.fast = 1 ota.gain = 8 ota.offset = 0 -mux.write() +#mux.write() # Secondary Chain1 @@ -174,6 +179,16 @@ amux.write() + +############################################################################## +# transient testing stuff +# +dac.vina(1.1) +dac.vinb(0.9) + + + + ############################################################################## # drop into an IPython shell # diff --git a/python-lib/usbio.py b/python-lib/usbio.py index 367f9c8..c9e1a6d 100644 --- a/python-lib/usbio.py +++ b/python-lib/usbio.py @@ -538,9 +538,11 @@ class Mux(object): def write(self): self.bus.SetCS(self.csname) - self.bus.Start() s = str(self) + self.bus.Start() + sleep(0.01) out = self.bus.Exchange(s) + sleep(0.01) self.bus.Stop() return out @@ -923,7 +925,7 @@ class AtoiSPI1(mpsse.MPSSE): self.context.pstart = 0xe8 elif name == 'chain1_conf': self.context.pidle = self.context.pstop = 0xf8 - self.context.pstart = 0xd0 + self.context.pstart = 0xd8 elif name == 'chain1_mux': self.context.pidle = self.context.pstop = 0xf8 self.context.pstart = 0xb8 -- 2.25.1