mirror of
https://github.com/open-sdr/openwifi.git
synced 2025-02-21 02:01:29 +00:00
New rf/ad9361 initialization script with new ad9361 filter file:
1. Wider bandwidth for 11n (4 extra subcarriers than 11a/g) 2. No offset tuning anymore
This commit is contained in:
parent
a5bde87733
commit
7d48624548
40
user_space/openwifi_ad9361_fir_tx_0MHz.ftr
Normal file
40
user_space/openwifi_ad9361_fir_tx_0MHz.ftr
Normal file
@ -0,0 +1,40 @@
|
||||
# Data Sample Frequency = 40000000 Hz
|
||||
TX 3 GAIN 0 INT 1
|
||||
RX 3 GAIN -6 DEC 1
|
||||
RTX 1280000000 160000000 80000000 40000000 40000000 40000000
|
||||
RRX 1280000000 160000000 80000000 40000000 40000000 40000000
|
||||
# BWTX 35301580
|
||||
BWTX 20172411
|
||||
BWRX 20172411
|
||||
-2628,-2628
|
||||
2130,2130
|
||||
1397,1397
|
||||
-487,-487
|
||||
-1098,-1098
|
||||
865,865
|
||||
2132,2132
|
||||
-112,-112
|
||||
-2468,-2468
|
||||
-169,-169
|
||||
3686,3686
|
||||
1455,1455
|
||||
-5304,-5304
|
||||
-4052,-4052
|
||||
11297,11297
|
||||
27949,27949
|
||||
27949,27949
|
||||
11297,11297
|
||||
-4052,-4052
|
||||
-5304,-5304
|
||||
1455,1455
|
||||
3686,3686
|
||||
-169,-169
|
||||
-2468,-2468
|
||||
-112,-112
|
||||
2132,2132
|
||||
865,865
|
||||
-1098,-1098
|
||||
-487,-487
|
||||
1397,1397
|
||||
2130,2130
|
||||
-2628,-2628
|
69
user_space/openwifi_ad9361_fir_tx_0MHz_11n.ftr
Normal file
69
user_space/openwifi_ad9361_fir_tx_0MHz_11n.ftr
Normal file
@ -0,0 +1,69 @@
|
||||
# Generated with AD9361 Filter Design Wizard 16.1.3-g924f0cd
|
||||
# MATLAB 9.10.0.1602886 (R2021a), 18-Nov-2021 11:34:55
|
||||
# Inputs:
|
||||
# Data Sample Frequency = 40000000 Hz
|
||||
# Filter = 2
|
||||
# Phase Equalization = 0
|
||||
# Use AD936x FIR = 1
|
||||
# Fpass = 8.750000e+00
|
||||
# Fstop = 1.125000e+01
|
||||
# Apass = 5.000000e-01
|
||||
# Astop = 80
|
||||
# Param = 0.000000
|
||||
# PLL rate = 1280
|
||||
# Converter = 320
|
||||
# Data rate = 40
|
||||
TX 3 GAIN -6 INT 1
|
||||
RX 3 GAIN -6 DEC 1
|
||||
RTX 1280000000 320000000 160000000 80000000 40000000 40000000
|
||||
RRX 1280000000 320000000 160000000 80000000 40000000 40000000
|
||||
BWTX 25215414
|
||||
BWRX 25215513
|
||||
41,56
|
||||
31,70
|
||||
-187,-148
|
||||
-496,-500
|
||||
-395,-434
|
||||
183,169
|
||||
412,436
|
||||
-201,-208
|
||||
-619,-674
|
||||
148,137
|
||||
886,956
|
||||
-38,-14
|
||||
-1232,-1325
|
||||
-166,-214
|
||||
1680,1799
|
||||
513,598
|
||||
-2284,-2437
|
||||
-1107,-1255
|
||||
3197,3389
|
||||
2238,2507
|
||||
-4904,-5127
|
||||
-5068,-5623
|
||||
10562,10560
|
||||
28812,29674
|
||||
28812,29674
|
||||
10562,10560
|
||||
-5068,-5623
|
||||
-4904,-5127
|
||||
2238,2507
|
||||
3197,3389
|
||||
-1107,-1255
|
||||
-2284,-2437
|
||||
513,598
|
||||
1680,1799
|
||||
-166,-214
|
||||
-1232,-1325
|
||||
-38,-14
|
||||
886,956
|
||||
148,137
|
||||
-619,-674
|
||||
-201,-208
|
||||
412,436
|
||||
183,169
|
||||
-395,-434
|
||||
-496,-500
|
||||
-187,-148
|
||||
31,70
|
||||
41,56
|
137
user_space/rf_init_11n.sh
Executable file
137
user_space/rf_init_11n.sh
Executable file
@ -0,0 +1,137 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Author: Xianjun Jiao
|
||||
# SPDX-FileCopyrightText: 2019 UGent
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
home_dir=$(pwd)
|
||||
|
||||
#if [ -z "$1" ]
|
||||
#then
|
||||
# tx_offset_tuning_enable=1
|
||||
#else
|
||||
tx_offset_tuning_enable=0
|
||||
#fi
|
||||
echo tx_offset_tuning_enable $tx_offset_tuning_enable
|
||||
|
||||
#if [ $tx_offset_tuning_enable = "1" ]
|
||||
#then
|
||||
# fir_filename="openwifi_ad9361_fir.ftr"
|
||||
# tx_fir_enable=0
|
||||
#else
|
||||
# fir_filename="openwifi_ad9361_fir_tx_0MHz.ftr"
|
||||
# tx_fir_enable=1
|
||||
#fi
|
||||
|
||||
fir_filename="openwifi_ad9361_fir_tx_0MHz_11n.ftr"
|
||||
tx_fir_enable=1
|
||||
|
||||
echo $fir_filename "tx_fir_enable" $tx_fir_enable
|
||||
|
||||
if test -f $fir_filename; then
|
||||
echo "Found" $fir_filename
|
||||
else
|
||||
echo "Can not find" $fir_filename
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -x
|
||||
if test -f "/sys/bus/iio/devices/iio:device0/in_voltage_rf_bandwidth"; then
|
||||
cd /sys/bus/iio/devices/iio:device0/
|
||||
else if test -f "/sys/bus/iio/devices/iio:device1/in_voltage_rf_bandwidth"; then
|
||||
cd /sys/bus/iio/devices/iio:device1/
|
||||
else if test -f "/sys/bus/iio/devices/iio:device2/in_voltage_rf_bandwidth"; then
|
||||
cd /sys/bus/iio/devices/iio:device2/
|
||||
else if test -f "/sys/bus/iio/devices/iio:device3/in_voltage_rf_bandwidth"; then
|
||||
cd /sys/bus/iio/devices/iio:device3/
|
||||
else if test -f "/sys/bus/iio/devices/iio:device4/in_voltage_rf_bandwidth"; then
|
||||
cd /sys/bus/iio/devices/iio:device4/
|
||||
else
|
||||
echo "Can not find in_voltage_rf_bandwidth!"
|
||||
echo "Check log to make sure ad9361 driver is loaded!"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
set +x
|
||||
|
||||
echo 25215513 > in_voltage_rf_bandwidth
|
||||
sync
|
||||
echo 25215414 > out_voltage_rf_bandwidth
|
||||
sync
|
||||
echo 40000000 > in_voltage_sampling_frequency
|
||||
sync
|
||||
echo 40000000 > out_voltage_sampling_frequency
|
||||
sync
|
||||
sleep 1
|
||||
|
||||
echo 1000000000 > out_altvoltage0_RX_LO_frequency
|
||||
sync
|
||||
echo 1000000000 > out_altvoltage1_TX_LO_frequency
|
||||
sync
|
||||
|
||||
cat $home_dir/$fir_filename > filter_fir_config
|
||||
sync
|
||||
sleep 0.5
|
||||
echo 1 > in_voltage_filter_fir_en
|
||||
echo $tx_fir_enable > out_voltage_filter_fir_en
|
||||
cat filter_fir_config
|
||||
cat in_voltage_filter_fir_en
|
||||
cat out_voltage_filter_fir_en
|
||||
|
||||
echo "rx0 agc fast_attack"
|
||||
#echo "rx0 agc manual"
|
||||
cat in_voltage0_gain_control_mode
|
||||
echo fast_attack > in_voltage0_gain_control_mode
|
||||
#echo manual > in_voltage0_gain_control_mode
|
||||
cat in_voltage0_gain_control_mode
|
||||
sync
|
||||
|
||||
echo "rx1 agc fast_attack"
|
||||
#echo "rx1 agc manual"
|
||||
cat in_voltage1_gain_control_mode
|
||||
echo fast_attack > in_voltage1_gain_control_mode
|
||||
#echo manual > in_voltage1_gain_control_mode
|
||||
cat in_voltage1_gain_control_mode
|
||||
sync
|
||||
sleep 1
|
||||
|
||||
cat in_voltage_sampling_frequency
|
||||
cat in_voltage_rf_bandwidth
|
||||
cat out_voltage_sampling_frequency
|
||||
cat out_voltage_rf_bandwidth
|
||||
|
||||
echo "rssi"
|
||||
cat in_voltage0_rssi
|
||||
cat in_voltage1_rssi
|
||||
|
||||
# # --------not needed maybe-------- # #
|
||||
echo "rx0 gain to 70" # this set gain is gpio gain - 5dB (test with agc and read back gpio in driver)
|
||||
cat in_voltage0_hardwaregain
|
||||
echo 70 > in_voltage0_hardwaregain
|
||||
cat in_voltage0_hardwaregain
|
||||
sync
|
||||
|
||||
echo "rx1 gain to 70"
|
||||
cat in_voltage1_hardwaregain
|
||||
echo 70 > in_voltage1_hardwaregain
|
||||
cat in_voltage1_hardwaregain
|
||||
sync
|
||||
|
||||
echo "tx0 gain -89dB"
|
||||
cat out_voltage0_hardwaregain
|
||||
echo -89 > out_voltage0_hardwaregain
|
||||
cat out_voltage0_hardwaregain
|
||||
sync
|
||||
|
||||
echo "tx1 gain 0dB"
|
||||
cat out_voltage1_hardwaregain
|
||||
echo 0 > out_voltage1_hardwaregain
|
||||
cat out_voltage1_hardwaregain
|
||||
sync
|
||||
# # --------not needed maybe-------- # #
|
||||
|
||||
cd $home_dir
|
||||
|
Loading…
x
Reference in New Issue
Block a user