WIP
authorDan White <dan@whiteaudio.com>
Sun, 6 May 2012 17:02:42 +0000 (12:02 -0500)
committerDan White <dan@whiteaudio.com>
Sun, 6 May 2012 17:02:42 +0000 (12:02 -0500)
python-lib/mpsse-test.py
python-lib/usbio.py

index e7335fd7b54d0e033a02052d4ee35a9dfa31e964..308eecd141687e3a09cb0905d786c48547bada4c 100755 (executable)
@@ -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
 #
index 367f9c8fa6ceeb0af177d9f3c826a09e749a33ac..c9e1a6dbcdc04b8b2276752a7b8fa2655cfdc7a8 100644 (file)
@@ -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