source: ResearchApps/PHY/WARPLAB/WARPLab_v05_2/WorkshopExercises/warplab_mimo_2x2_GUIinitialize.m

Last change on this file was 1455, checked in by sgupta, 12 years ago

workshop exercises

File size: 2.9 KB
Line 
1
2%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3% Start of Code to avoid conflict between users, only needed for the
4% workshop
5%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6% fid = fopen('c:\boards_lock.txt');
7%
8% if(fid > -1)
9%   fclose('all');
10%     errordlg('Boards already in use - Please try again!');
11%   okToUseBoards = 0;
12%   return;
13% end
14%
15% !echo > c:\boards_lock.txt
16% okToUseBoards = 1;
17
18%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
19% End of Code to avoid conflict between users, only needed for the
20% workshop
21%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
22
23% Create arp entry for magic sync
24!arp -s 10.0.0.244 ff-ff-ff-ff-ff-ff 10.0.0.200
25
26%Close any stale sockets before trying to create new ones
27pnet('closeall');
28
29%Load some global definitions (packet types, etc.)
30warplab_mimo_2x2_GUIdefines;
31
32%Initial packet number
33warplab_mimo_2x2_GUI.pktNoTx = 1;
34
35%Define nodes
36warplab_mimo_2x2_GUI.nodes = [1:2];
37
38%Define the nodes' IP addresses & UDP ports
39% The IP address and UDP port ranges must match those hardc-coded in the FPGA
40warplab_mimo_2x2_GUI.IPAddrs = warplab_IP2int('10.0.0.0') + warplab_mimo_2x2_GUI.nodes;
41warplab_mimo_2x2_GUI.UDP_Ports = 9000 + warplab_mimo_2x2_GUI.nodes-1;
42
43%Define the magic SYNC address; this must match the address hard-coded in the FPGA
44warplab_mimo_2x2_GUI.MagicSyncAddr = '10.0.0.244';
45
46warplab_mimo_2x2_GUI.socketHandles = warplab_initNets(warplab_mimo_2x2_GUI.MagicSyncAddr, warplab_mimo_2x2_GUI.IPAddrs, warplab_mimo_2x2_GUI.UDP_Ports);
47
48%Initialize the individual nodes
49warplab_initNodes(warplab_mimo_2x2_GUI.socketHandles);
50
51%Separate the socket handles for easier access
52% The first socket handle is always the magic SYNC
53% The rest can be arranged in any combination of Tx and Rx
54warplab_mimo_2x2_GUI.udp_Sync = warplab_mimo_2x2_GUI.socketHandles(1);
55warplab_mimo_2x2_GUI.udp_node1 = warplab_mimo_2x2_GUI.socketHandles(2);
56warplab_mimo_2x2_GUI.udp_node2 = warplab_mimo_2x2_GUI.socketHandles(3);
57% warplab_mimo_2x2_GUI.CaptOffset = 1000; %Number of noise samples per Rx capture; in [0:2^14]
58warplab_mimo_2x2_GUI.TxDelay = 1000; %Number of noise samples per Rx capture; in [0:2^14]
59warplab_mimo_2x2_GUI.TxLength = 2^14-1; %Length of transmission; in [0:2^14-CaptOffset]
60warplab_mimo_2x2_GUI.CarrierChannel = 8; % Channel in the 2.4 GHz band. In [1:14]
61warplab_mimo_2x2_GUI.TxA_BB = 3; %Tx Baseband Gain in [0:3]
62warplab_mimo_2x2_GUI.TxA_RF = 40; %Tx RF Gain in [0:63]
63warplab_mimo_2x2_GUI.RxA_BB = 13; %Rx Baseband Gain in [0:31]
64warplab_mimo_2x2_GUI.RxA_RF = 1; %Rx RF Gain in [1:3]
65warplab_mimo_2x2_GUI.TxB_BB = 3; %Tx Baseband Gain in [0:3]
66warplab_mimo_2x2_GUI.TxB_RF = 40; %Tx RF Gain in [0:63]
67warplab_mimo_2x2_GUI.RxB_BB = 13; %Rx Baseband Gain in [0:31]
68warplab_mimo_2x2_GUI.RxB_RF = 1; %Rx RF Gain in [1:3]
69warplab_mimo_2x2_GUI.TxSelect = 2;
70warplab_mimo_2x2_GUI.RxSelect = 2;
Note: See TracBrowser for help on using the repository browser.