r4644 - developers/werner/wlan-spi/vds

werner at docs.openmoko.org werner at docs.openmoko.org
Tue Sep 16 02:04:41 CEST 2008


Author: werner
Date: 2008-09-16 02:04:40 +0200 (Tue, 16 Sep 2008)
New Revision: 4644

Modified:
   developers/werner/wlan-spi/vds/vds.py
   developers/werner/wlan-spi/vds/view
Log:
New test setup that's much less prone to false triggers.



Modified: developers/werner/wlan-spi/vds/vds.py
===================================================================
--- developers/werner/wlan-spi/vds/vds.py	2008-09-13 02:59:24 UTC (rev 4643)
+++ developers/werner/wlan-spi/vds/vds.py	2008-09-16 00:04:40 UTC (rev 4644)
@@ -7,29 +7,55 @@
 s = rigol_ds1000c()
 
 s.hor.pos = 0
-s.hor.scale = 2e-3	# 2ms is enough for 10MSa/s
+s.hor.scale = 500e-6	# 500us is enough for 100MSa/s
 
 ch = s.ch[0]
-ch.pos = 0.7
-ch.scale = 0.2
+ch.pos = 1.5
+ch.scale = 0.5
 
-# getting too much noise - need to find a better signal
-edge(slope = slope.Falling, level = 0.4).source(ch)
+edge(slope = slope.Rising, level = 1.5).source(ch)
 
 s.hor.sweep = sweep.Single
 s.hor.stop()
 
-for tr in range(0, 100):
-    for rep in range(1, 3):
-	os.system("ssh lab neo ./gpio b1=0")
+
+def system(cmd):
+    ret = os.system(cmd)
+    print cmd, "->", "%x" % ret
+    while ret & 0xff:
+	pass
+
+
+for i in range(0, 100):
+    # pseudo-randomize the trigger time to that we collect samples from a wider
+    # range more quickly
+    tr = (i*41) % 100
+
+    for rep in range(0, 3):
+	# reset trigger
+	system("ssh lab neo ./gpio f6=zr")
+
+	# start scope
 	s.hor.run()
-	os.system("ssh lab neo ./trigger "+str(tr))
-	os.system("ssh lab dbgrst")
+
+	# set the next trigger time (see the script "trigger" for details)
+	system("ssh lab neo ./trigger "+str(tr))
+
+	# hard reset the device
+	system("ssh lab dbgrst")
+
+	# wait for trigger
 	while s.hor.state() != state.Stop:
 	    time.sleep(1)
-	w = s.wave([ch, 1, 2, 3, 4, 5, 6], start = -10e-6, end = 4e-3)
-	# grab a little bit before the message and a lot after
+
+	# grab the transmission(s) - a bit before the message and a lot after
+	w = s.wave([ch, 1, 2, 3, 4, 5, 6], start = -1e-3, end = 1e-3)
 	w.save("sdio-"+str(tr)+"-"+str(rep))
-	print "Zzz..."
-	time.sleep(20)
-	print "AWAKE!"
+
+	# Give the system time to finish booting
+	print "Saved", tr, rep
+	time.sleep(50)
+	print "AWAKE"
+
+	# record the kernel messages as well
+	os.system("ssh lab neo dmesg -s 2000000 >dmesg-"+str(tr)+"-"+str(rep))

Modified: developers/werner/wlan-spi/vds/view
===================================================================
--- developers/werner/wlan-spi/vds/view	2008-09-13 02:59:24 UTC (rev 4643)
+++ developers/werner/wlan-spi/vds/view	2008-09-16 00:04:40 UTC (rev 4644)
@@ -2,7 +2,7 @@
 gnuplot -persist <<EOF
 set style data lines
 set yrange [:7]
-plot "$1" using 1:2 title "Trigger", \
+plot "$1" using 1:(\$2/3) title "Trigger", \
   "$1" using 1:(\$3/2+2) title "CLK", \
   "$1" using 1:(\$4/2+3) title "CMD/MOSI", \
   "$1" using 1:(\$5/2+4) title "DATA0/MISO", \




More information about the commitlog mailing list