commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r7200 - in usrp2/trunk: firmware/apps host/apps


From: eb
Subject: [Commit-gnuradio] r7200 - in usrp2/trunk: firmware/apps host/apps
Date: Sat, 15 Dec 2007 16:30:45 -0700 (MST)

Author: eb
Date: 2007-12-15 16:30:45 -0700 (Sat, 15 Dec 2007)
New Revision: 7200

Added:
   usrp2/trunk/host/apps/gen_sine.py
Modified:
   usrp2/trunk/firmware/apps/rx_only.c
Log:
working tx test code

Modified: usrp2/trunk/firmware/apps/rx_only.c
===================================================================
--- usrp2/trunk/firmware/apps/rx_only.c 2007-12-15 23:28:39 UTC (rev 7199)
+++ usrp2/trunk/firmware/apps/rx_only.c 2007-12-15 23:30:45 UTC (rev 7200)
@@ -66,7 +66,7 @@
 // 4 lines of ethernet hdr + 1 line (word0)
 // DSP Rx writes timestamp followed by nlines_per_frame of samples
 #define DSP_RX_FIRST_LINE                5
-#define DSP_RX_SAMPLES_PER_FRAME       100
+#define DSP_RX_SAMPLES_PER_FRAME       119
 #define        DSP_RX_EXTRA_LINES                1     // writes timestamp
 
 // receive from DSP
@@ -161,7 +161,7 @@
   dsp_rx_regs->scale_iq = (1 << 16) | 1;
   dsp_rx_regs->decim_rate = 63;        // register gets N - 1
 
-  uint32_t cmd = MK_RX_CMD(1 * DSP_RX_SAMPLES_PER_FRAME, 
DSP_RX_SAMPLES_PER_FRAME);
+  uint32_t cmd = MK_RX_CMD(10000 * DSP_RX_SAMPLES_PER_FRAME + 2, 
DSP_RX_SAMPLES_PER_FRAME);
   // printf("rx_command = "); puthex32_nl(cmd);
   dsp_rx_regs->rx_command = cmd;
 

Added: usrp2/trunk/host/apps/gen_sine.py
===================================================================
--- usrp2/trunk/host/apps/gen_sine.py                           (rev 0)
+++ usrp2/trunk/host/apps/gen_sine.py   2007-12-15 23:30:45 UTC (rev 7200)
@@ -0,0 +1,63 @@
+#!/usr/bin/env python
+#
+# Copyright 2007 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+from gnuradio import gr, eng_notation
+from gnuradio.eng_option import eng_option
+from optparse import OptionParser
+import sys
+
+master_clock = 100e6
+
+class my_top_block(gr.top_block):
+
+    def __init__(self):
+        gr.top_block.__init__(self)
+
+        parser = OptionParser(option_class=eng_option)
+        parser.add_option("-f", "--freq", type="eng_float", default=1e6,
+                          help="set waveform frequency to FREQ 
[default=%default]")
+        parser.add_option ("-a", "--amplitude", type="eng_float", default=16e3,
+                           help="set waveform amplitude to AMPLITUDE 
[default=%default]", metavar="AMPL")
+
+        parser.add_option("-i", "--interp", type="int", default=32,
+                          help="assume fgpa interpolation rate is INTERP 
[default=%default]")
+
+        (options, args) = parser.parse_args ()
+        if len(args) != 0:
+            parser.print_help()
+            raise SystemExit, 1
+
+        
+        src0 = gr.sig_source_c(master_clock/options.interp,
+                               gr.GR_SIN_WAVE,
+                               options.freq,
+                               options.amplitude)
+
+        
+        c2s = gr.complex_to_interleaved_short()
+
+        stdout_sink = gr.file_descriptor_sink(gr.sizeof_short, 1)
+
+        self.connect(src0, c2s, stdout_sink)
+
+        
+if __name__ == '__main__':
+    try:
+        my_top_block().run()
+    except KeyboardInterrupt:
+        pass


Property changes on: usrp2/trunk/host/apps/gen_sine.py
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:eol-style
   + native





reply via email to

[Prev in Thread] Current Thread [Next in Thread]