Azzera filtri
Azzera filtri

How do I set the clock and time references of USRP to external reference or to MIMO cable for a secondary USRP?

42 visualizzazioni (ultimi 30 giorni)
I am using the Communications Toolbox with USRP2 and USRP N210 SDRs to build a MIMO system. Specifically, I am building an Rx antenna array for indoor wireless positioning using directional of arrival concept and USRP2 or USRP210 devices (Daughter board XCVR2450). I perform parallel computing as follows:
matlabpool open 2
switch (labindex)
case 1
case 2
Now, I want to configure the clock and time reference of USRP to an external GPS source because all USRPs in the array should be synchronized. I want the USRP to get its references externally or, in the case of using two USRPs, from MIMO cable (one controller and one receiver).

Risposta accettata

MathWorks Support Team
MathWorks Support Team il 17 Mag 2024
Modificato: MathWorks Support Team il 17 Mag 2024
After R2016a:
External Clock and PPS Source are available since R2016a. GPSDO support is available with USRP Hardware Support Package since R2021a.
Both External or GPSDO Clock Source and PPS source can be used with USRP by setting the "ClockSource" and "PPSSource" property of the "comm.SDRuReceiver" system object.
Before R2016a:
External clock reference for USRP radios and data stream synchronization via the MIMO cable is not directly supported in releases prior to R2016a. 
The following workaround may be useful to program both the Reference clock source and PPS clock source to be external. Please note that this is an undocumented workaround, which may not work starting in R2014b.
Please note that R2013a onwards, steps 1 and 5 are not required.
Edit the 'UsrpMaskMapiT.m' file. This file resides under the
'commusrp/usrp_uhd_mapi' directory in the USRP Support Package installation directory.
Edit line 55 to change 'setClockConfig' to 'setClockConfigFull'
Power up the USRP radio.
Connect the 10 MHz reference clock to the Reference Clock input (e.g. +7dBm sine wave).
Click the "Add SDRu" shortcut, which should be in the root MATLAB window after installing the USRP Support Package.
If you are not using Simulink blocks and are working from the MATLAB Command Window or writing a MATLAB script or function, you may skip steps 6 and 7.
Build or load the Simulink model with the USRP block.
Open the USRP block mask by double-clicking on the block. Then, close the mask.
At the MATLAB Command Window, please enter the following commands:
h = UsrpMaskMapiT('', BoardIdCapiEnumT.MboardId)
9) At this point, the E LED on USRP2 should light steadily, indicating that the USRP2 has locked to the reference clock. If it flickers or is not lit, check your reference. It may be off frequency or at an incorrect level.
Now, you can run your model, function, or script. If you disconnect or power down the USRP radio, you must repeat steps 7 and 8.
If you skip step 7, the E LED may light up, but you may not receive any data. If you would like to see the options or mix internal/external for ref/pps, modify step (8) to be:
h = UsrpMaskMapiT('', BoardIdCapiEnumT.MboardId)
c = ClockConfigCapiT
c.refSource = RefSourceCapiEnumT.External
c.ppsSource = PPSSourceCapiEnumT.External
c.ppsPolarity = PPSPolarityCapiEnumT.Positive
You should be able to change from external clocking to internal clocking by shutting down MATLAB and restarting it.

Più risposte (1)

Karunya Choppara
Karunya Choppara il 19 Set 2023
Modificato: MathWorks Support Team il 27 Mag 2024 alle 5:56
GPSDO support is available with USRP Hardware Support Package since R2021a.
Both External or GPSDO Clock Source and PPS source can be used with USRP by setting the ClockSource and PPSSource property of system object.


Scopri di più su Communications Toolbox in Help Center e File Exchange


Non è stata ancora inserito alcun tag.




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by