当前位置:   article > 正文

USRP_B210之FPGA分析5:编译生成BIT流下替换试验_usrp的双发双收

usrp的双发双收

这里用的是UHD的B210代码,我们编译过了之后在替换掉UHD里面提供的B210 IMAGE,看运行FPGA功能是否正常,如果正常,以后的试验和改进就在这个些代码上进行了。

使用的UHD版本是3.15,没有替换固件之前,我运行了一下UHD_USRP_PORBE 显示如下

  1. a@z:~/uhd-3.15.0.0/host/build/examples$ uhd_usrp_probe
  2. [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.0-0-unknown
  3. [INFO] [B200] Loading firmware image: /usr/local/share/uhd/images/usrp_b200_fw.hex...
  4. [INFO] [B200] Detected Device: B210
  5. [INFO] [B200] Loading FPGA image: /usr/local/share/uhd/images/usrp_b210_fpga.bin...
  6. [INFO] [B200] Operating over USB 3.
  7. [INFO] [B200] Detecting internal GPSDO....
  8. [INFO] [GPS] No GPSDO found
  9. [INFO] [B200] Initialize CODEC control...
  10. [INFO] [B200] Initialize Radio control...
  11. [INFO] [B200] Performing register loopback test...
  12. [INFO] [B200] Register loopback test passed
  13. [INFO] [B200] Performing register loopback test...
  14. [INFO] [B200] Register loopback test passed
  15. [INFO] [B200] Setting master clock rate selection to 'automatic'.
  16. [INFO] [B200] Asking for clock rate 16.000000 MHz...
  17. [INFO] [B200] Actually got clock rate 16.000000 MHz.
  18. _____________________________________________________
  19. /
  20. | Device: B-Series Device
  21. | _____________________________________________________
  22. | /
  23. | | Mboard: B210
  24. | | serial: 180007
  25. | | name: MyB210
  26. | | product: 2
  27. | | revision: 4
  28. | | FW Version: 8.0
  29. | | FPGA Version: 16.0
  30. | |
  31. | | Time sources: none, internal, external, gpsdo
  32. | | Clock sources: internal, external, gpsdo
  33. | | Sensors: ref_locked
  34. | | _____________________________________________________
  35. | | /
  36. | | | RX DSP: 0
  37. | | |
  38. | | | Freq range: -8.000 to 8.000 MHz
  39. | | _____________________________________________________
  40. | | /
  41. | | | RX DSP: 1
  42. | | |
  43. | | | Freq range: -8.000 to 8.000 MHz
  44. | | _____________________________________________________
  45. | | /
  46. | | | RX Dboard: A
  47. | | | _____________________________________________________
  48. | | | /
  49. | | | | RX Frontend: A
  50. | | | | Name: FE-RX2
  51. | | | | Antennas: TX/RX, RX2
  52. | | | | Sensors: temp, rssi, lo_locked
  53. | | | | Freq range: 50.000 to 6000.000 MHz
  54. | | | | Gain range PGA: 0.0 to 76.0 step 1.0 dB
  55. | | | | Bandwidth range: 200000.0 to 56000000.0 step 0.0 Hz
  56. | | | | Connection Type: IQ
  57. | | | | Uses LO offset: No
  58. | | | _____________________________________________________
  59. | | | /
  60. | | | | RX Frontend: B
  61. | | | | Name: FE-RX1
  62. | | | | Antennas: TX/RX, RX2
  63. | | | | Sensors: temp, rssi, lo_locked
  64. | | | | Freq range: 50.000 to 6000.000 MHz
  65. | | | | Gain range PGA: 0.0 to 76.0 step 1.0 dB
  66. | | | | Bandwidth range: 200000.0 to 56000000.0 step 0.0 Hz
  67. | | | | Connection Type: IQ
  68. | | | | Uses LO offset: No
  69. | | | _____________________________________________________
  70. | | | /
  71. | | | | RX Codec: A
  72. | | | | Name: B210 RX dual ADC
  73. | | | | Gain Elements: None
  74. | | _____________________________________________________
  75. | | /
  76. | | | TX DSP: 0
  77. | | |
  78. | | | Freq range: -8.000 to 8.000 MHz
  79. | | _____________________________________________________
  80. | | /
  81. | | | TX DSP: 1
  82. | | |
  83. | | | Freq range: -8.000 to 8.000 MHz
  84. | | _____________________________________________________
  85. | | /
  86. | | | TX Dboard: A
  87. | | | _____________________________________________________
  88. | | | /
  89. | | | | TX Frontend: A
  90. | | | | Name: FE-TX2
  91. | | | | Antennas: TX/RX
  92. | | | | Sensors: temp, lo_locked
  93. | | | | Freq range: 50.000 to 6000.000 MHz
  94. | | | | Gain range PGA: 0.0 to 89.8 step 0.2 dB
  95. | | | | Bandwidth range: 200000.0 to 56000000.0 step 0.0 Hz
  96. | | | | Connection Type: IQ
  97. | | | | Uses LO offset: No
  98. | | | _____________________________________________________
  99. | | | /
  100. | | | | TX Frontend: B
  101. | | | | Name: FE-TX1
  102. | | | | Antennas: TX/RX
  103. | | | | Sensors: temp, lo_locked
  104. | | | | Freq range: 50.000 to 6000.000 MHz
  105. | | | | Gain range PGA: 0.0 to 89.8 step 0.2 dB
  106. | | | | Bandwidth range: 200000.0 to 56000000.0 step 0.0 Hz
  107. | | | | Connection Type: IQ
  108. | | | | Uses LO offset: No
  109. | | | _____________________________________________________
  110. | | | /
  111. | | | | TX Codec: A
  112. | | | | Name: B210 TX dual DAC
  113. | | | | Gain Elements: None
  114. a@z:~/uhd-3.15.0.0/host/build/examples$ ^C

我们看到下载的固件是/usr/local/share/uhd/images/usrp_b210_fpga.bin

这里我们把自己编译生成的FPGA配置文件B200.BIN拷贝替换这个文件,替换前先备份一下。

替换之后我们再运行uhd_usrp_probe一下看看结果:

  1. a@z:~/uhd-3.15.0.0/host/build/examples$ sudo uhd_usrp_probe
  2. [INFO] [UHD] linux; GNU C++ version 7.5.0; Boost_106501; UHD_3.15.0.0-0-unknown
  3. [INFO] [B200] Loading firmware image: /usr/local/share/uhd/images/usrp_b200_fw.hex...
  4. [INFO] [B200] Detected Device: B210
  5. [INFO] [B200] Loading FPGA image: /usr/local/share/uhd/images/usrp_b210_fpga.bin...
  6. [INFO] [B200] Operating over USB 3.
  7. [INFO] [B200] Detecting internal GPSDO....
  8. [INFO] [GPS] No GPSDO found
  9. [INFO] [B200] Initialize CODEC control...
  10. [INFO] [B200] Initialize Radio control...
  11. [INFO] [B200] Performing register loopback test...
  12. [INFO] [B200] Register loopback test passed
  13. [INFO] [B200] Performing register loopback test...
  14. [INFO] [B200] Register loopback test passed
  15. [INFO] [B200] Setting master clock rate selection to 'automatic'.
  16. [INFO] [B200] Asking for clock rate 16.000000 MHz...
  17. [INFO] [B200] Actually got clock rate 16.000000 MHz.
  18. _____________________________________________________
  19. /
  20. | Device: B-Series Device
  21. | _____________________________________________________
  22. | /
  23. | | Mboard: B210
  24. | | serial: 180007
  25. | | name: MyB210
  26. | | product: 2
  27. | | revision: 4
  28. | | FW Version: 8.0
  29. | | FPGA Version: 16.0
  30. | |
  31. | | Time sources: none, internal, external, gpsdo
  32. | | Clock sources: internal, external, gpsdo
  33. | | Sensors: ref_locked
  34. | | _____________________________________________________
  35. | | /
  36. | | | RX DSP: 0
  37. | | |
  38. | | | Freq range: -8.000 to 8.000 MHz
  39. | | _____________________________________________________
  40. | | /
  41. | | | RX DSP: 1
  42. | | |
  43. | | | Freq range: -8.000 to 8.000 MHz
  44. | | _____________________________________________________
  45. | | /
  46. | | | RX Dboard: A
  47. | | | _____________________________________________________
  48. | | | /
  49. | | | | RX Frontend: A
  50. | | | | Name: FE-RX2
  51. | | | | Antennas: TX/RX, RX2
  52. | | | | Sensors: temp, rssi, lo_locked
  53. | | | | Freq range: 50.000 to 6000.000 MHz
  54. | | | | Gain range PGA: 0.0 to 76.0 step 1.0 dB
  55. | | | | Bandwidth range: 200000.0 to 56000000.0 step 0.0 Hz
  56. | | | | Connection Type: IQ
  57. | | | | Uses LO offset: No
  58. | | | _____________________________________________________
  59. | | | /
  60. | | | | RX Frontend: B
  61. | | | | Name: FE-RX1
  62. | | | | Antennas: TX/RX, RX2
  63. | | | | Sensors: temp, rssi, lo_locked
  64. | | | | Freq range: 50.000 to 6000.000 MHz
  65. | | | | Gain range PGA: 0.0 to 76.0 step 1.0 dB
  66. | | | | Bandwidth range: 200000.0 to 56000000.0 step 0.0 Hz
  67. | | | | Connection Type: IQ
  68. | | | | Uses LO offset: No
  69. | | | _____________________________________________________
  70. | | | /
  71. | | | | RX Codec: A
  72. | | | | Name: B210 RX dual ADC
  73. | | | | Gain Elements: None
  74. | | _____________________________________________________
  75. | | /
  76. | | | TX DSP: 0
  77. | | |
  78. | | | Freq range: -8.000 to 8.000 MHz
  79. | | _____________________________________________________
  80. | | /
  81. | | | TX DSP: 1
  82. | | |
  83. | | | Freq range: -8.000 to 8.000 MHz
  84. | | _____________________________________________________
  85. | | /
  86. | | | TX Dboard: A
  87. | | | _____________________________________________________
  88. | | | /
  89. | | | | TX Frontend: A
  90. | | | | Name: FE-TX2
  91. | | | | Antennas: TX/RX
  92. | | | | Sensors: temp, lo_locked
  93. | | | | Freq range: 50.000 to 6000.000 MHz
  94. | | | | Gain range PGA: 0.0 to 89.8 step 0.2 dB
  95. | | | | Bandwidth range: 200000.0 to 56000000.0 step 0.0 Hz
  96. | | | | Connection Type: IQ
  97. | | | | Uses LO offset: No
  98. | | | _____________________________________________________
  99. | | | /
  100. | | | | TX Frontend: B
  101. | | | | Name: FE-TX1
  102. | | | | Antennas: TX/RX
  103. | | | | Sensors: temp, lo_locked
  104. | | | | Freq range: 50.000 to 6000.000 MHz
  105. | | | | Gain range PGA: 0.0 to 89.8 step 0.2 dB
  106. | | | | Bandwidth range: 200000.0 to 56000000.0 step 0.0 Hz
  107. | | | | Connection Type: IQ
  108. | | | | Uses LO offset: No
  109. | | | _____________________________________________________
  110. | | | /
  111. | | | | TX Codec: A
  112. | | | | Name: B210 TX dual DAC
  113. | | | | Gain Elements: None

接下来我简单试验下:

1,运行FFT程序,测试通过,uhd_fft ,界面如下:

2,运行双收双发程序,界面如下:

运行结果完全正确,如下: 

 这里看到一切正常,我们最好也测试一下GPSDO 是否正常WORK。

这里是测试的PYTHON代码:

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. #
  4. # SPDX-License-Identifier: GPL-3.0
  5. #
  6. # GNU Radio Python Flow Graph
  7. # Title: Top Block
  8. # GNU Radio version: 3.8.0.0
  9. from distutils.version import StrictVersion
  10. if __name__ == '__main__':
  11. import ctypes
  12. import sys
  13. if sys.platform.startswith('linux'):
  14. try:
  15. x11 = ctypes.cdll.LoadLibrary('libX11.so')
  16. x11.XInitThreads()
  17. except:
  18. print("Warning: failed to XInitThreads()")
  19. from PyQt5 import Qt
  20. from gnuradio import qtgui
  21. from gnuradio.filter import firdes
  22. import sip
  23. from gnuradio import analog
  24. from gnuradio import blocks
  25. from gnuradio import gr
  26. import sys
  27. import signal
  28. from argparse import ArgumentParser
  29. from gnuradio.eng_arg import eng_float, intx
  30. from gnuradio import eng_notation
  31. from gnuradio import uhd
  32. import time
  33. from gnuradio import qtgui
  34. class top_block(gr.top_block, Qt.QWidget):
  35. def __init__(self):
  36. gr.top_block.__init__(self, "Top Block")
  37. Qt.QWidget.__init__(self)
  38. self.setWindowTitle("Top Block")
  39. qtgui.util.check_set_qss()
  40. try:
  41. self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
  42. except:
  43. pass
  44. self.top_scroll_layout = Qt.QVBoxLayout()
  45. self.setLayout(self.top_scroll_layout)
  46. self.top_scroll = Qt.QScrollArea()
  47. self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
  48. self.top_scroll_layout.addWidget(self.top_scroll)
  49. self.top_scroll.setWidgetResizable(True)
  50. self.top_widget = Qt.QWidget()
  51. self.top_scroll.setWidget(self.top_widget)
  52. self.top_layout = Qt.QVBoxLayout(self.top_widget)
  53. self.top_grid_layout = Qt.QGridLayout()
  54. self.top_layout.addLayout(self.top_grid_layout)
  55. self.settings = Qt.QSettings("GNU Radio", "top_block")
  56. try:
  57. if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"):
  58. self.restoreGeometry(self.settings.value("geometry").toByteArray())
  59. else:
  60. self.restoreGeometry(self.settings.value("geometry"))
  61. except:
  62. pass
  63. ##################################################
  64. # Variables
  65. ##################################################
  66. self.samp_rate = samp_rate = 32000
  67. self.RF_FRQ = RF_FRQ = 2.7E9
  68. ##################################################
  69. # Blocks
  70. ##################################################
  71. self.uhd_usrp_source_1 = uhd.usrp_source(
  72. ",".join(("", "")),
  73. uhd.stream_args(
  74. cpu_format="fc32",
  75. args='',
  76. channels=[0,1],
  77. ),
  78. )
  79. self.uhd_usrp_source_1.set_center_freq(RF_FRQ, 0)
  80. self.uhd_usrp_source_1.set_normalized_gain(1, 0)
  81. self.uhd_usrp_source_1.set_antenna('RX2', 0)
  82. self.uhd_usrp_source_1.set_center_freq(RF_FRQ, 1)
  83. self.uhd_usrp_source_1.set_normalized_gain(1, 1)
  84. self.uhd_usrp_source_1.set_antenna('RX2', 1)
  85. self.uhd_usrp_source_1.set_samp_rate(samp_rate)
  86. self.uhd_usrp_source_1.set_time_unknown_pps(uhd.time_spec())
  87. self.uhd_usrp_sink_0 = uhd.usrp_sink(
  88. ",".join(("", "")),
  89. uhd.stream_args(
  90. cpu_format="fc32",
  91. args='',
  92. channels=[0,1],
  93. ),
  94. '',
  95. )
  96. self.uhd_usrp_sink_0.set_center_freq(RF_FRQ, 0)
  97. self.uhd_usrp_sink_0.set_normalized_gain(0.8, 0)
  98. self.uhd_usrp_sink_0.set_antenna('TX/RX', 0)
  99. self.uhd_usrp_sink_0.set_center_freq(RF_FRQ, 1)
  100. self.uhd_usrp_sink_0.set_normalized_gain(0.8, 1)
  101. self.uhd_usrp_sink_0.set_antenna('TX/RX', 1)
  102. self.uhd_usrp_sink_0.set_samp_rate(samp_rate)
  103. self.uhd_usrp_sink_0.set_time_unknown_pps(uhd.time_spec())
  104. self.qtgui_time_sink_x_0_0 = qtgui.time_sink_c(
  105. 1024, #size
  106. samp_rate, #samp_rate
  107. "B", #name
  108. 1 #number of inputs
  109. )
  110. self.qtgui_time_sink_x_0_0.set_update_time(0.10)
  111. self.qtgui_time_sink_x_0_0.set_y_axis(-1, 1)
  112. self.qtgui_time_sink_x_0_0.set_y_label('Amplitude', "")
  113. self.qtgui_time_sink_x_0_0.enable_tags(True)
  114. self.qtgui_time_sink_x_0_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "")
  115. self.qtgui_time_sink_x_0_0.enable_autoscale(False)
  116. self.qtgui_time_sink_x_0_0.enable_grid(False)
  117. self.qtgui_time_sink_x_0_0.enable_axis_labels(True)
  118. self.qtgui_time_sink_x_0_0.enable_control_panel(False)
  119. self.qtgui_time_sink_x_0_0.enable_stem_plot(False)
  120. labels = ['', '', '', '', '',
  121. '', '', '', '', '']
  122. widths = [1, 1, 1, 1, 1,
  123. 1, 1, 1, 1, 1]
  124. colors = ['blue', 'red', 'green', 'black', 'cyan',
  125. 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue']
  126. alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
  127. 1.0, 1.0, 1.0, 1.0, 1.0]
  128. styles = [1, 1, 1, 1, 1,
  129. 1, 1, 1, 1, 1]
  130. markers = [-1, -1, -1, -1, -1,
  131. -1, -1, -1, -1, -1]
  132. for i in range(2):
  133. if len(labels[i]) == 0:
  134. if (i % 2 == 0):
  135. self.qtgui_time_sink_x_0_0.set_line_label(i, "Re{{Data {0}}}".format(i/2))
  136. else:
  137. self.qtgui_time_sink_x_0_0.set_line_label(i, "Im{{Data {0}}}".format(i/2))
  138. else:
  139. self.qtgui_time_sink_x_0_0.set_line_label(i, labels[i])
  140. self.qtgui_time_sink_x_0_0.set_line_width(i, widths[i])
  141. self.qtgui_time_sink_x_0_0.set_line_color(i, colors[i])
  142. self.qtgui_time_sink_x_0_0.set_line_style(i, styles[i])
  143. self.qtgui_time_sink_x_0_0.set_line_marker(i, markers[i])
  144. self.qtgui_time_sink_x_0_0.set_line_alpha(i, alphas[i])
  145. self._qtgui_time_sink_x_0_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0_0.pyqwidget(), Qt.QWidget)
  146. self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_0_win)
  147. self.qtgui_time_sink_x_0 = qtgui.time_sink_c(
  148. 1024, #size
  149. samp_rate, #samp_rate
  150. "A+", #name
  151. 1 #number of inputs
  152. )
  153. self.qtgui_time_sink_x_0.set_update_time(0.10)
  154. self.qtgui_time_sink_x_0.set_y_axis(-1, 1)
  155. self.qtgui_time_sink_x_0.set_y_label('Amplitude', "")
  156. self.qtgui_time_sink_x_0.enable_tags(True)
  157. self.qtgui_time_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, qtgui.TRIG_SLOPE_POS, 0.0, 0, 0, "")
  158. self.qtgui_time_sink_x_0.enable_autoscale(False)
  159. self.qtgui_time_sink_x_0.enable_grid(False)
  160. self.qtgui_time_sink_x_0.enable_axis_labels(True)
  161. self.qtgui_time_sink_x_0.enable_control_panel(False)
  162. self.qtgui_time_sink_x_0.enable_stem_plot(False)
  163. labels = ['', '', '', '', '',
  164. '', '', '', '', '']
  165. widths = [1, 1, 1, 1, 1,
  166. 1, 1, 1, 1, 1]
  167. colors = ['blue', 'red', 'green', 'black', 'cyan',
  168. 'magenta', 'yellow', 'dark red', 'dark green', 'dark blue']
  169. alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
  170. 1.0, 1.0, 1.0, 1.0, 1.0]
  171. styles = [1, 1, 1, 1, 1,
  172. 1, 1, 1, 1, 1]
  173. markers = [-1, -1, -1, -1, -1,
  174. -1, -1, -1, -1, -1]
  175. for i in range(2):
  176. if len(labels[i]) == 0:
  177. if (i % 2 == 0):
  178. self.qtgui_time_sink_x_0.set_line_label(i, "Re{{Data {0}}}".format(i/2))
  179. else:
  180. self.qtgui_time_sink_x_0.set_line_label(i, "Im{{Data {0}}}".format(i/2))
  181. else:
  182. self.qtgui_time_sink_x_0.set_line_label(i, labels[i])
  183. self.qtgui_time_sink_x_0.set_line_width(i, widths[i])
  184. self.qtgui_time_sink_x_0.set_line_color(i, colors[i])
  185. self.qtgui_time_sink_x_0.set_line_style(i, styles[i])
  186. self.qtgui_time_sink_x_0.set_line_marker(i, markers[i])
  187. self.qtgui_time_sink_x_0.set_line_alpha(i, alphas[i])
  188. self._qtgui_time_sink_x_0_win = sip.wrapinstance(self.qtgui_time_sink_x_0.pyqwidget(), Qt.QWidget)
  189. self.top_grid_layout.addWidget(self._qtgui_time_sink_x_0_win)
  190. self.qtgui_freq_sink_x_0 = qtgui.freq_sink_c(
  191. 1024, #size
  192. firdes.WIN_BLACKMAN_hARRIS, #wintype
  193. 0, #fc
  194. samp_rate, #bw
  195. "蓝色+", #name
  196. 2
  197. )
  198. self.qtgui_freq_sink_x_0.set_update_time(0.10)
  199. self.qtgui_freq_sink_x_0.set_y_axis(-140, 10)
  200. self.qtgui_freq_sink_x_0.set_y_label('Relative Gain', 'dB')
  201. self.qtgui_freq_sink_x_0.set_trigger_mode(qtgui.TRIG_MODE_FREE, 0.0, 0, "")
  202. self.qtgui_freq_sink_x_0.enable_autoscale(False)
  203. self.qtgui_freq_sink_x_0.enable_grid(False)
  204. self.qtgui_freq_sink_x_0.set_fft_average(1.0)
  205. self.qtgui_freq_sink_x_0.enable_axis_labels(True)
  206. self.qtgui_freq_sink_x_0.enable_control_panel(False)
  207. labels = ['', '', '', '', '',
  208. '', '', '', '', '']
  209. widths = [1, 1, 1, 1, 1,
  210. 1, 1, 1, 1, 1]
  211. colors = ["blue", "red", "green", "black", "cyan",
  212. "magenta", "yellow", "dark red", "dark green", "dark blue"]
  213. alphas = [1.0, 1.0, 1.0, 1.0, 1.0,
  214. 1.0, 1.0, 1.0, 1.0, 1.0]
  215. for i in range(2):
  216. if len(labels[i]) == 0:
  217. self.qtgui_freq_sink_x_0.set_line_label(i, "Data {0}".format(i))
  218. else:
  219. self.qtgui_freq_sink_x_0.set_line_label(i, labels[i])
  220. self.qtgui_freq_sink_x_0.set_line_width(i, widths[i])
  221. self.qtgui_freq_sink_x_0.set_line_color(i, colors[i])
  222. self.qtgui_freq_sink_x_0.set_line_alpha(i, alphas[i])
  223. self._qtgui_freq_sink_x_0_win = sip.wrapinstance(self.qtgui_freq_sink_x_0.pyqwidget(), Qt.QWidget)
  224. self.top_grid_layout.addWidget(self._qtgui_freq_sink_x_0_win)
  225. self.blocks_null_source_0 = blocks.null_source(gr.sizeof_gr_complex*1)
  226. self.analog_sig_source_x_0 = analog.sig_source_c(samp_rate, analog.GR_COS_WAVE, 1000, 1, 0, 0)
  227. ##################################################
  228. # Connections
  229. ##################################################
  230. self.connect((self.analog_sig_source_x_0, 0), (self.uhd_usrp_sink_0, 0))
  231. self.connect((self.blocks_null_source_0, 0), (self.uhd_usrp_sink_0, 1))
  232. self.connect((self.uhd_usrp_source_1, 0), (self.qtgui_freq_sink_x_0, 0))
  233. self.connect((self.uhd_usrp_source_1, 1), (self.qtgui_freq_sink_x_0, 1))
  234. self.connect((self.uhd_usrp_source_1, 0), (self.qtgui_time_sink_x_0, 0))
  235. self.connect((self.uhd_usrp_source_1, 1), (self.qtgui_time_sink_x_0_0, 0))
  236. def closeEvent(self, event):
  237. self.settings = Qt.QSettings("GNU Radio", "top_block")
  238. self.settings.setValue("geometry", self.saveGeometry())
  239. event.accept()
  240. def get_samp_rate(self):
  241. return self.samp_rate
  242. def set_samp_rate(self, samp_rate):
  243. self.samp_rate = samp_rate
  244. self.analog_sig_source_x_0.set_sampling_freq(self.samp_rate)
  245. self.qtgui_freq_sink_x_0.set_frequency_range(0, self.samp_rate)
  246. self.qtgui_time_sink_x_0.set_samp_rate(self.samp_rate)
  247. self.qtgui_time_sink_x_0_0.set_samp_rate(self.samp_rate)
  248. self.uhd_usrp_sink_0.set_samp_rate(self.samp_rate)
  249. self.uhd_usrp_source_1.set_samp_rate(self.samp_rate)
  250. def get_RF_FRQ(self):
  251. return self.RF_FRQ
  252. def set_RF_FRQ(self, RF_FRQ):
  253. self.RF_FRQ = RF_FRQ
  254. self.uhd_usrp_sink_0.set_center_freq(self.RF_FRQ, 0)
  255. self.uhd_usrp_sink_0.set_center_freq(self.RF_FRQ, 1)
  256. self.uhd_usrp_source_1.set_center_freq(self.RF_FRQ, 0)
  257. self.uhd_usrp_source_1.set_center_freq(self.RF_FRQ, 1)
  258. def main(top_block_cls=top_block, options=None):
  259. if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"):
  260. style = gr.prefs().get_string('qtgui', 'style', 'raster')
  261. Qt.QApplication.setGraphicsSystem(style)
  262. qapp = Qt.QApplication(sys.argv)
  263. tb = top_block_cls()
  264. tb.start()
  265. tb.show()
  266. def sig_handler(sig=None, frame=None):
  267. Qt.QApplication.quit()
  268. signal.signal(signal.SIGINT, sig_handler)
  269. signal.signal(signal.SIGTERM, sig_handler)
  270. timer = Qt.QTimer()
  271. timer.start(500)
  272. timer.timeout.connect(lambda: None)
  273. def quitting():
  274. tb.stop()
  275. tb.wait()
  276. qapp.aboutToQuit.connect(quitting)
  277. qapp.exec_()
  278. if __name__ == '__main__':
  279. main()

3,测试GPSDO正常工作。这个后续再进行测试吧,手边没有可用GPSDO。

4,另外也要也要测试下外部PPS输入和外部10M REF_CLK的输入。

这里后续都要做做。

---------------------------------------------------------------------------------------------------------------------------------

下面要进行的是,关于ad9361的sample_rate的测量试验。其实思路也简单,就是将radio_clk分频后从一个IO上面引出来后用示波器测量。这样做的目的是为了验证GNURADIO里面采样率设置和实际SAMPLE_RATE的关系,后面详细讲。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/花生_TL007/article/detail/404959
推荐阅读
相关标签
  

闽ICP备14008679号