mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-06 06:53:37 +00:00
WIP: rework 2.LO + add dwell time
This commit is contained in:
parent
a2abc0c2af
commit
24314e2361
33 changed files with 483 additions and 190 deletions
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>488</width>
|
||||
<height>364</height>
|
||||
<width>487</width>
|
||||
<height>356</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
|
@ -141,7 +141,7 @@
|
|||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
|||
|
|
@ -428,6 +428,13 @@ bool LibreVNADriver::setVNA(const DeviceDriver::VNASettings &s, std::function<vo
|
|||
p.settings.cdbm_excitation_start = s.dBmStart * 100;
|
||||
p.settings.cdbm_excitation_stop = s.dBmStop * 100;
|
||||
p.settings.stages = s.excitedPorts.size() - 1;
|
||||
auto dwell_us = s.dwellTime * 1e6;
|
||||
if(dwell_us < 0) {
|
||||
dwell_us = 0;
|
||||
} else if(dwell_us > UINT16_MAX) {
|
||||
dwell_us = UINT16_MAX;
|
||||
}
|
||||
p.settings.dwell_time = dwell_us;
|
||||
p.settings.suppressPeaks = VNASuppressInvalidPeaks ? 1 : 0;
|
||||
p.settings.fixedPowerSetting = VNAAdjustPowerLevel || s.dBmStart != s.dBmStop ? 0 : 1;
|
||||
p.settings.logSweep = s.logSweep ? 1 : 0;
|
||||
|
|
@ -664,7 +671,7 @@ void LibreVNADriver::handleReceivedPacket(const Protocol::PacketInfo &packet)
|
|||
info.firmware_version = QString::number(packet.info.FW_major)+"."+QString::number(packet.info.FW_minor)+"."+QString::number(packet.info.FW_patch);
|
||||
info.hardware_version = hardwareVersionToString(packet.info.hardware_version)+" Rev."+QString(packet.info.HW_Revision);
|
||||
info.supportedFeatures = {
|
||||
Feature::VNA, Feature::VNAFrequencySweep, Feature::VNALogSweep, Feature::VNAPowerSweep, Feature::VNAZeroSpan,
|
||||
Feature::VNA, Feature::VNAFrequencySweep, Feature::VNALogSweep, Feature::VNAPowerSweep, Feature::VNAZeroSpan, Feature::VNADwellTime,
|
||||
Feature::Generator,
|
||||
Feature::SA, Feature::SATrackingGenerator, Feature::SATrackingOffset,
|
||||
Feature::ExtRefIn, Feature::ExtRefOut,
|
||||
|
|
@ -677,6 +684,8 @@ void LibreVNADriver::handleReceivedPacket(const Protocol::PacketInfo &packet)
|
|||
info.Limits.VNA.maxIFBW = packet.info.limits_maxIFBW;
|
||||
info.Limits.VNA.mindBm = (double) packet.info.limits_cdbm_min / 100;
|
||||
info.Limits.VNA.maxdBm = (double) packet.info.limits_cdbm_max / 100;
|
||||
info.Limits.VNA.minDwellTime = (double) packet.info.limits_minDwellTime * 1e-6;
|
||||
info.Limits.VNA.maxDwellTime = (double) packet.info.limits_maxDwellTime * 1e-6;
|
||||
|
||||
info.Limits.Generator.ports = packet.info.num_ports;
|
||||
info.Limits.Generator.minFreq = packet.info.limits_minFreq;
|
||||
|
|
|
|||
|
|
@ -118,6 +118,8 @@ DeviceDriver::Info::Info()
|
|||
Limits.VNA.minIFBW = 1;
|
||||
Limits.VNA.maxIFBW = 100000000;
|
||||
Limits.VNA.maxPoints = 65535;
|
||||
Limits.VNA.minDwellTime = 0;
|
||||
Limits.VNA.maxDwellTime = 1;
|
||||
|
||||
Limits.Generator.ports = 2;
|
||||
Limits.Generator.minFreq = 0;
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ public:
|
|||
VNAPowerSweep,
|
||||
VNAZeroSpan,
|
||||
VNALogSweep,
|
||||
VNADwellTime,
|
||||
// Generator features
|
||||
Generator,
|
||||
// Spectrum analyzer features
|
||||
|
|
@ -101,6 +102,8 @@ public:
|
|||
unsigned int maxPoints;
|
||||
// Stimulus level limits in dBm
|
||||
double mindBm, maxdBm;
|
||||
// dwell time limts
|
||||
double minDwellTime, maxDwellTime;
|
||||
} VNA;
|
||||
struct {
|
||||
// Number of ports
|
||||
|
|
@ -264,6 +267,8 @@ public:
|
|||
bool logSweep;
|
||||
// List of ports that should be excited during the sweep (port count starts at 1)
|
||||
std::vector<int> excitedPorts;
|
||||
// amount of time the source stays at each point before taking measurements. Ignore if not supported
|
||||
double dwellTime;
|
||||
};
|
||||
|
||||
class VNAMeasurement {
|
||||
|
|
|
|||
|
|
@ -72,6 +72,14 @@ namespace Util {
|
|||
return brightness > 0.6 ? Qt::black : Qt::white;
|
||||
}
|
||||
|
||||
template<typename T> void constrain(T &value, const T &min, const T &max) {
|
||||
if(value > max) {
|
||||
value = max;
|
||||
} else if(value < min) {
|
||||
value = min;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Performs interpolation of a list of sorted values.
|
||||
* T: type of the elements in the list. Must contain a value by which these elements are sorted in the list.
|
||||
|
|
|
|||
|
|
@ -454,6 +454,14 @@ VNA::VNA(AppWindow *window, QString name)
|
|||
tb_acq->addWidget(new QLabel("IF BW:"));
|
||||
tb_acq->addWidget(eBandwidth);
|
||||
|
||||
tb_acq->addWidget(new QLabel("Dwell time:"));
|
||||
acquisitionDwellTime = new SIUnitEdit("s", "um ", 3);
|
||||
width = QFontMetrics(dbm->font()).horizontalAdvance("100ms") + 20;
|
||||
acquisitionDwellTime->setFixedWidth(width);
|
||||
connect(acquisitionDwellTime, &SIUnitEdit::valueChanged, this, &VNA::SetDwellTime);
|
||||
connect(this, &VNA::dwellTimeChanged, acquisitionDwellTime, &SIUnitEdit::setValueQuiet);
|
||||
tb_acq->addWidget(acquisitionDwellTime);
|
||||
|
||||
tb_acq->addWidget(new QLabel("Averaging:"));
|
||||
lAverages = new QLabel("0/");
|
||||
tb_acq->addWidget(lAverages);
|
||||
|
|
@ -1235,6 +1243,17 @@ void VNA::SetSourceLevel(double level)
|
|||
SettingsChanged();
|
||||
}
|
||||
|
||||
void VNA::SetDwellTime(double time) {
|
||||
if(time > DeviceDriver::getInfo(window->getDevice()).Limits.VNA.maxDwellTime) {
|
||||
time = DeviceDriver::getInfo(window->getDevice()).Limits.VNA.maxDwellTime;
|
||||
} else if(time < DeviceDriver::getInfo(window->getDevice()).Limits.VNA.minDwellTime) {
|
||||
time = DeviceDriver::getInfo(window->getDevice()).Limits.VNA.minDwellTime;
|
||||
}
|
||||
emit dwellTimeChanged(time);
|
||||
settings.dwellTime = time;
|
||||
SettingsChanged();
|
||||
}
|
||||
|
||||
void VNA::SetStartPower(double level)
|
||||
{
|
||||
settings.Power.start = level;
|
||||
|
|
@ -1652,6 +1671,37 @@ void VNA::UpdateCalWidget()
|
|||
calLabel->setToolTip(getCalToolTip());
|
||||
}
|
||||
|
||||
void VNA::ConstrainAllSettings()
|
||||
{
|
||||
auto maxFreq = DeviceDriver::getInfo(window->getDevice()).Limits.VNA.maxFreq;
|
||||
auto minFreq = DeviceDriver::getInfo(window->getDevice()).Limits.VNA.minFreq;
|
||||
auto maxPower = DeviceDriver::getInfo(window->getDevice()).Limits.VNA.maxdBm;
|
||||
auto minPower = DeviceDriver::getInfo(window->getDevice()).Limits.VNA.mindBm;
|
||||
auto maxIFBW = DeviceDriver::getInfo(window->getDevice()).Limits.VNA.maxIFBW;
|
||||
auto minIFBW = DeviceDriver::getInfo(window->getDevice()).Limits.VNA.minIFBW;
|
||||
auto maxDwell = DeviceDriver::getInfo(window->getDevice()).Limits.VNA.maxDwellTime;
|
||||
auto minDwell = DeviceDriver::getInfo(window->getDevice()).Limits.VNA.minDwellTime;
|
||||
auto maxPoints = DeviceDriver::getInfo(window->getDevice()).Limits.VNA.maxPoints;
|
||||
Util::constrain(settings.Freq.start, minFreq, maxFreq);
|
||||
Util::constrain(settings.Freq.stop, minFreq, maxFreq);
|
||||
Util::constrain(settings.Freq.excitation_power, minPower, maxPower);
|
||||
Util::constrain(settings.bandwidth, minIFBW, maxIFBW);
|
||||
Util::constrain(settings.dwellTime, minDwell, maxDwell);
|
||||
Util::constrain(settings.npoints, (unsigned int) 0, maxPoints);
|
||||
Util::constrain(settings.Power.frequency, minFreq, maxFreq);
|
||||
Util::constrain(settings.Power.start, minPower, maxPower);
|
||||
Util::constrain(settings.Power.stop, minPower, maxPower);
|
||||
emit startFreqChanged(settings.Freq.start);
|
||||
emit stopFreqChanged(settings.Freq.stop);
|
||||
emit sourceLevelChanged(settings.Freq.excitation_power);
|
||||
emit IFBandwidthChanged(settings.bandwidth);
|
||||
emit dwellTimeChanged(settings.dwellTime);
|
||||
emit pointsChanged(settings.npoints);
|
||||
emit powerSweepFrequencyChanged(settings.Power.frequency);
|
||||
emit startPowerChanged(settings.Power.start);
|
||||
emit stopPowerChanged(settings.Power.stop);
|
||||
}
|
||||
|
||||
void VNA::createDefaultTracesAndGraphs(int ports)
|
||||
{
|
||||
auto getDefaultColor = [](int ports, int i, int j)->QColor {
|
||||
|
|
@ -1780,6 +1830,16 @@ void VNA::preset()
|
|||
createDefaultTracesAndGraphs(DeviceDriver::getInfo(window->getDevice()).Limits.VNA.ports);
|
||||
}
|
||||
|
||||
void VNA::deviceInfoUpdated()
|
||||
{
|
||||
if(DeviceDriver::getInfo(window->getDevice()).supportedFeatures.count(DeviceDriver::Feature::VNADwellTime)) {
|
||||
acquisitionDwellTime->setEnabled(true);
|
||||
} else {
|
||||
acquisitionDwellTime->setEnabled(false);
|
||||
}
|
||||
ConstrainAllSettings();
|
||||
}
|
||||
|
||||
QString VNA::SweepTypeToString(VNA::SweepType sw)
|
||||
{
|
||||
switch(sw) {
|
||||
|
|
@ -1904,6 +1964,7 @@ void VNA::ConfigureDevice(bool resetTraces, std::function<void(bool)> cb)
|
|||
s.dBmStop = stop;
|
||||
s.logSweep = false;
|
||||
}
|
||||
s.dwellTime = settings.dwellTime;
|
||||
if(window->getDevice() && isActive) {
|
||||
window->getDevice()->setVNA(s, [=](bool res){
|
||||
// device received command, reset traces now
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ public:
|
|||
|
||||
void preset() override;
|
||||
|
||||
virtual void deviceInfoUpdated() override;
|
||||
|
||||
QList<QAction*> getImportOptions() override { return importActions;}
|
||||
QList<QAction*> getExportOptions() override { return exportActions;}
|
||||
|
||||
|
|
@ -72,6 +74,7 @@ public:
|
|||
} Power;
|
||||
unsigned int npoints;
|
||||
double bandwidth;
|
||||
double dwellTime;
|
||||
std::vector<int> excitedPorts;
|
||||
// if the number of points is higher than supported by the hardware, the sweep has to be segmented into multiple parts
|
||||
int segments;
|
||||
|
|
@ -109,6 +112,7 @@ private slots:
|
|||
void SetLogSweep(bool log);
|
||||
// Acquisition control
|
||||
void SetSourceLevel(double level);
|
||||
void SetDwellTime(double time);
|
||||
// Power sweep settings
|
||||
void SetStartPower(double level);
|
||||
void SetStopPower(double level);
|
||||
|
|
@ -135,6 +139,7 @@ private:
|
|||
void LoadSweepSettings();
|
||||
void StoreSweepSettings();
|
||||
void UpdateCalWidget();
|
||||
void ConstrainAllSettings();
|
||||
|
||||
void createDefaultTracesAndGraphs(int ports);
|
||||
private slots:
|
||||
|
|
@ -155,6 +160,9 @@ private:
|
|||
QTimer configurationTimer;
|
||||
bool configurationTimerResetTraces;
|
||||
|
||||
// Toolbar elements
|
||||
SIUnitEdit *acquisitionDwellTime;
|
||||
|
||||
// Calibration
|
||||
Calibration cal;
|
||||
bool changingSettings;
|
||||
|
|
@ -205,6 +213,7 @@ signals:
|
|||
void pointsChanged(unsigned int points);
|
||||
void IFBandwidthChanged(double bandwidth);
|
||||
void averagingChanged(unsigned int averages);
|
||||
void dwellTimeChanged(double time);
|
||||
|
||||
void startPowerChanged(double level);
|
||||
void stopPowerChanged(double level);
|
||||
|
|
|
|||
|
|
@ -268,9 +268,7 @@ inline void App_Process() {
|
|||
{
|
||||
Protocol::PacketInfo send;
|
||||
send.type = Protocol::PacketType::DeviceConfiguration;
|
||||
send.deviceConfig.V1.IF1 = HW::getIF1();
|
||||
send.deviceConfig.V1.ADCprescaler = HW::getADCPrescaler();
|
||||
send.deviceConfig.V1.DFTphaseInc = HW::getDFTPhaseInc();
|
||||
send.deviceConfig = HW::getDeviceConfig();
|
||||
Communication::Send(send);
|
||||
}
|
||||
break;
|
||||
|
|
@ -334,7 +332,50 @@ inline void App_Process() {
|
|||
}
|
||||
}
|
||||
|
||||
#include "HW_HAL.hpp"
|
||||
|
||||
void App_Start() {
|
||||
App_Init();
|
||||
|
||||
// uint32_t LO2_1 = 61750000;
|
||||
// uint32_t LO2_2 = 61752000;
|
||||
//
|
||||
// HWHAL::Si5351.Enable(HWHAL::SiChannel::Port1LO2);
|
||||
// HWHAL::Si5351.Enable(HWHAL::SiChannel::Port2LO2);
|
||||
// HWHAL::Si5351.Enable(HWHAL::SiChannel::RefLO2);
|
||||
//
|
||||
//// HWHAL::Si5351.Disable(HWHAL::SiChannel::Port1LO2);
|
||||
//// HWHAL::Si5351.Disable(HWHAL::SiChannel::Port2LO2);
|
||||
//// HWHAL::Si5351.Disable(HWHAL::SiChannel::RefLO2);
|
||||
//
|
||||
//// FPGA::Enable(FPGA::Periphery::Port1Mixer);
|
||||
//// FPGA::Enable(FPGA::Periphery::Port2Mixer);
|
||||
//// FPGA::Enable(FPGA::Periphery::RefMixer);
|
||||
//
|
||||
// uint32_t i=64000000;
|
||||
// HWHAL::Si5351.SetCLK(HWHAL::SiChannel::Port1LO2, i, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
// HWHAL::Si5351.SetCLK(HWHAL::SiChannel::Port2LO2, i, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
// HWHAL::Si5351.SetCLK(HWHAL::SiChannel::RefLO2, i, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
// HWHAL::Si5351.ResetPLL(Si5351C::PLL::B);
|
||||
// while(1) {
|
||||
// for(i=61000000;i<62000000;i++) {
|
||||
// LOG_INFO("Setting LO2=%lu", i);
|
||||
// HWHAL::Si5351.SetPLL(Si5351C::PLL::B, i*13, Si5351C::PLLSource::XTAL);
|
||||
//// HWHAL::Si5351.Disable(HWHAL::SiChannel::Port1LO2);
|
||||
//// HWHAL::Si5351.Disable(HWHAL::SiChannel::Port2LO2);
|
||||
//// HWHAL::Si5351.Disable(HWHAL::SiChannel::RefLO2);
|
||||
//// HWHAL::Si5351.SetCLK(HWHAL::SiChannel::Port1LO2, i, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
//// HWHAL::Si5351.SetCLK(HWHAL::SiChannel::Port2LO2, i, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
//// HWHAL::Si5351.SetCLK(HWHAL::SiChannel::RefLO2, i, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
//
|
||||
//// HWHAL::Si5351.Enable(HWHAL::SiChannel::Port1LO2);
|
||||
//// HWHAL::Si5351.Enable(HWHAL::SiChannel::Port2LO2);
|
||||
//// HWHAL::Si5351.Enable(HWHAL::SiChannel::RefLO2);
|
||||
//// HWHAL::Si5351.ResetPLL(Si5351C::PLL::B);
|
||||
//// HWHAL::Si5351.WaitForLock(Si5351C::PLL::B, 10);
|
||||
// vTaskDelay(1);
|
||||
// }
|
||||
// }
|
||||
|
||||
App_Process();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ using namespace PacketConstants;
|
|||
|
||||
namespace Protocol {
|
||||
|
||||
static constexpr uint16_t Version = 13;
|
||||
static constexpr uint16_t Version = 14;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
|
|
@ -180,6 +180,7 @@ using SweepSettings = struct _sweepSettings {
|
|||
uint16_t unused2:1;
|
||||
|
||||
int16_t cdbm_excitation_stop; // in 1/100 dbm
|
||||
uint16_t dwell_time; // in us
|
||||
};
|
||||
|
||||
using ReferenceSettings = struct _referenceSettings {
|
||||
|
|
@ -215,6 +216,8 @@ using DeviceInfo = struct _deviceInfo {
|
|||
uint8_t limits_maxAmplitudePoints;
|
||||
uint64_t limits_maxFreqHarmonic;
|
||||
uint8_t num_ports;
|
||||
uint16_t limits_minDwellTime;
|
||||
uint16_t limits_maxDwellTime;
|
||||
};
|
||||
|
||||
using DeviceStatus = struct _deviceStatus {
|
||||
|
|
|
|||
|
|
@ -132,6 +132,17 @@ void FPGA::SetSamplesPerPoint(uint32_t nsamples) {
|
|||
WriteRegister(Reg::SamplesPerPoint, nsamples);
|
||||
}
|
||||
|
||||
void FPGA::SetSettlingTime(uint16_t us) {
|
||||
// register is in multiples of 1/102.4 MHz
|
||||
uint32_t value = (uint32_t) us * 512 / 5;
|
||||
constexpr uint32_t maxval = 0xFFFFF;
|
||||
if(value > maxval) {
|
||||
value = maxval;
|
||||
}
|
||||
WriteRegister(Reg::SettlingTimeLow, value & 0xFFFF);
|
||||
WriteRegister(Reg::SettlingTimeHigh, value >> 16);
|
||||
}
|
||||
|
||||
void FPGA::SetupSweep(uint8_t stages, uint8_t port1_stage, uint8_t port2_stage, bool synchronize, bool syncMaster) {
|
||||
uint16_t value = 0x0000;
|
||||
value |= (uint16_t) (stages & 0x07) << 13;
|
||||
|
|
@ -199,7 +210,7 @@ void FPGA::WriteMAX2871Default(uint32_t *DefaultRegs) {
|
|||
}
|
||||
|
||||
void FPGA::WriteSweepConfig(uint16_t pointnum, bool lowband, uint32_t *SourceRegs, uint32_t *LORegs,
|
||||
uint8_t attenuation, uint64_t frequency, SettlingTime settling, Samples samples, bool halt, LowpassFilter filter) {
|
||||
uint8_t attenuation, uint64_t frequency, Samples samples, bool halt, LowpassFilter filter) {
|
||||
uint16_t send[7];
|
||||
// select which point this sweep config is for
|
||||
send[0] = pointnum & 0x1FFF;
|
||||
|
|
@ -222,7 +233,12 @@ void FPGA::WriteSweepConfig(uint16_t pointnum, bool lowband, uint32_t *SourceReg
|
|||
if (halt) {
|
||||
send[1] |= 0x8000;
|
||||
}
|
||||
send[1] |= (int) settling << 13;
|
||||
if(LO_N & 0x40) {
|
||||
send[1] |= 0x4000;
|
||||
}
|
||||
if(Source_N & 0x40) {
|
||||
send[1] |= 0x2000;
|
||||
}
|
||||
send[1] |= (int) samples << 10;
|
||||
if(filter == LowpassFilter::Auto) {
|
||||
// Select source LP filter
|
||||
|
|
@ -239,13 +255,13 @@ void FPGA::WriteSweepConfig(uint16_t pointnum, bool lowband, uint32_t *SourceReg
|
|||
send[1] |= (int) filter << 8;
|
||||
}
|
||||
send[2] = (LO_M & 0x000F) << 12 | LO_FRAC;
|
||||
send[3] = LO_DIV_A << 13 | LO_VCO << 7 | LO_N << 1;
|
||||
send[3] = LO_DIV_A << 13 | LO_VCO << 7 | (LO_N & 0x3F) << 1;
|
||||
if (lowband) {
|
||||
send[3] |= 0x0001;
|
||||
}
|
||||
send[4] = Source_Power << 14 | (uint16_t) attenuation << 7 | Source_M >> 5;
|
||||
send[5] = (Source_M & 0x001F) << 11 | Source_FRAC >> 1;
|
||||
send[6] = (Source_FRAC & 0x0001) << 15 | Source_DIV_A << 12 | Source_VCO << 6 | Source_N;
|
||||
send[6] = (Source_FRAC & 0x0001) << 15 | Source_DIV_A << 12 | Source_VCO << 6 | (Source_N & 0x3F);
|
||||
SwitchBytes(send[0]);
|
||||
SwitchBytes(send[1]);
|
||||
SwitchBytes(send[2]);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,8 @@ enum class Reg {
|
|||
MAX2871Def4MSB = 0x0F,
|
||||
DFTFirstBin = 0x12,
|
||||
DFTFreqSpacing = 0x13,
|
||||
SettlingTimeLow = 0x14,
|
||||
SettlingTimeHigh = 0x15,
|
||||
};
|
||||
|
||||
using SamplingResult = struct _samplingresult {
|
||||
|
|
@ -82,13 +84,6 @@ enum class LowpassFilter {
|
|||
Auto = 0xFF,
|
||||
};
|
||||
|
||||
enum class SettlingTime {
|
||||
us20 = 0x00,
|
||||
us60 = 0x01,
|
||||
us180 = 0x02,
|
||||
us540 = 0x03,
|
||||
};
|
||||
|
||||
enum class Samples {
|
||||
SPPRegister = 0x00,
|
||||
S96 = 0x01,
|
||||
|
|
@ -114,6 +109,7 @@ bool Init(HaltedCallback cb = nullptr);
|
|||
void WriteRegister(FPGA::Reg reg, uint16_t value);
|
||||
void SetNumberOfPoints(uint16_t npoints);
|
||||
void SetSamplesPerPoint(uint32_t nsamples);
|
||||
void SetSettlingTime(uint16_t us);
|
||||
void SetupSweep(uint8_t stages, uint8_t port1_stage, uint8_t port2_stage, bool synchronize = false, bool syncMaster = false);
|
||||
void Enable(Periphery p, bool enable = true);
|
||||
void Disable(Periphery p);
|
||||
|
|
@ -124,7 +120,7 @@ void DisableInterrupt(Interrupt i);
|
|||
void DisableAllInterrupts();
|
||||
void WriteMAX2871Default(uint32_t *DefaultRegs);
|
||||
void WriteSweepConfig(uint16_t pointnum, bool lowband, uint32_t *SourceRegs, uint32_t *LORegs,
|
||||
uint8_t attenuation, uint64_t frequency, SettlingTime settling, Samples samples, bool halt = false, LowpassFilter filter = LowpassFilter::Auto);
|
||||
uint8_t attenuation, uint64_t frequency, Samples samples, bool halt = false, LowpassFilter filter = LowpassFilter::Auto);
|
||||
using ReadCallback = void(*)(const SamplingResult &result);
|
||||
bool InitiateSampleRead(ReadCallback cb);
|
||||
void SetupDFT(uint32_t f_firstBin, uint32_t f_binSpacing);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ bool Si5351C::SetPLL(PLL pll, uint32_t frequency, PLLSource src) {
|
|||
FindOptimalDivider(frequency, srcFreq, c.P1, c.P2, c.P3);
|
||||
|
||||
FreqPLL[(int) pll] = frequency;
|
||||
LOG_INFO("Setting PLL %c to %luHz", pll==PLL::A ? 'A' : 'B', frequency);
|
||||
LOG_DEBUG("Setting PLL %c to %luHz", pll==PLL::A ? 'A' : 'B', frequency);
|
||||
return WritePLLConfig(c, pll);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@
|
|||
using namespace HWHAL;
|
||||
|
||||
void Generator::Setup(Protocol::GeneratorSettings g) {
|
||||
// Disable 2.LO
|
||||
Si5351.Disable(SiChannel::Port1LO2);
|
||||
Si5351.Disable(SiChannel::Port2LO2);
|
||||
Si5351.Disable(SiChannel::RefLO2);
|
||||
|
||||
HW::SetMode(HW::Mode::Generator);
|
||||
if(g.activePort == 0) {
|
||||
// both ports disabled, no need to configure PLLs
|
||||
|
|
|
|||
|
|
@ -115,21 +115,25 @@ bool HW::Init() {
|
|||
|
||||
// Both MAX2871 get a 100MHz reference
|
||||
// Si5351.SetBypass(SiChannel::Source, Si5351C::PLLSource::XTAL);
|
||||
Si5351.SetCLK(SiChannel::Source, HW::PLLRef, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.SetCLK(SiChannel::Source, HW::PLLRef, Si5351C::PLL::A, Si5351C::DriveStrength::mA8);
|
||||
Si5351.Enable(SiChannel::Source);
|
||||
// Si5351.SetBypass(SiChannel::LO1, Si5351C::PLLSource::XTAL);
|
||||
Si5351.SetCLK(SiChannel::LO1, HW::PLLRef, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.SetCLK(SiChannel::LO1, HW::PLLRef, Si5351C::PLL::A, Si5351C::DriveStrength::mA8);
|
||||
Si5351.Enable(SiChannel::LO1);
|
||||
// 16MHz FPGA clock
|
||||
Si5351.SetCLK(SiChannel::FPGA, HW::FPGAClkInFrequency, Si5351C::PLL::A, Si5351C::DriveStrength::mA2);
|
||||
Si5351.SetCLK(SiChannel::FPGA, HW::FPGAClkInFrequency, Si5351C::PLL::A, Si5351C::DriveStrength::mA8);
|
||||
Si5351.Enable(SiChannel::FPGA);
|
||||
|
||||
// Generate second LO with Si5351
|
||||
Si5351.SetCLK(SiChannel::Port1LO2, IF1 - IF2, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
// The 2.LO frequency is only set up here once. The frequencies chosen for DefaultLO2 and PLL B must
|
||||
// have an integer divisor. When changing the 2.LO frequency after this point, the PLL B frequency is
|
||||
// changed instead of modifying the clock output dividers. Otherwise, phase reversal may happen
|
||||
// intermittently at one or multiple 2.LO outputs. See also https://github.com/jankae/LibreVNA/issues/280
|
||||
Si5351.SetCLK(SiChannel::Port1LO2, DefaultLO2, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.Enable(SiChannel::Port1LO2);
|
||||
Si5351.SetCLK(SiChannel::Port2LO2, IF1 - IF2, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.SetCLK(SiChannel::Port2LO2, DefaultLO2, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.Enable(SiChannel::Port2LO2);
|
||||
Si5351.SetCLK(SiChannel::RefLO2, IF1 - IF2, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.SetCLK(SiChannel::RefLO2, DefaultLO2, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.Enable(SiChannel::RefLO2);
|
||||
|
||||
// PLL reset appears to realign phases of clock signals
|
||||
|
|
@ -152,6 +156,9 @@ bool HW::Init() {
|
|||
// Set phase increment according to
|
||||
FPGA::WriteRegister(FPGA::Reg::PhaseIncrement, DFTphaseInc);
|
||||
|
||||
// Set default settling time
|
||||
FPGA::SetSettlingTime(HW::DefaultDwellTime);
|
||||
|
||||
Exti::SetCallback(FPGA_INTR_GPIO_Port, FPGA_INTR_Pin, Exti::EdgeType::Rising, Exti::Pull::Down, FPGA_Interrupt);
|
||||
|
||||
// Initialize PLLs and build VCO maps
|
||||
|
|
@ -413,6 +420,14 @@ void HW::Ref::update() {
|
|||
}
|
||||
}
|
||||
|
||||
Si5351C::PLLSource HW::Ref::getSource() {
|
||||
if(extRefInUse) {
|
||||
return Si5351C::PLLSource::CLKIN;
|
||||
} else {
|
||||
return Si5351C::PLLSource::XTAL;
|
||||
}
|
||||
}
|
||||
|
||||
void HW::setAcquisitionFrequencies(Protocol::DeviceConfig s) {
|
||||
IF1 = s.V1.IF1;
|
||||
ADCprescaler = s.V1.ADCprescaler;
|
||||
|
|
@ -422,6 +437,14 @@ void HW::setAcquisitionFrequencies(Protocol::DeviceConfig s) {
|
|||
ADCsamplerate = ADCrate;
|
||||
}
|
||||
|
||||
Protocol::DeviceConfig HW::getDeviceConfig() {
|
||||
Protocol::DeviceConfig s;
|
||||
s.V1.ADCprescaler = ADCprescaler;
|
||||
s.V1.DFTphaseInc = DFTphaseInc;
|
||||
s.V1.IF1 = IF1;
|
||||
return s;
|
||||
}
|
||||
|
||||
uint32_t HW::getIF1() {
|
||||
return IF1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ static constexpr uint32_t TCXOFrequency = 26000000;
|
|||
static constexpr uint32_t ExtRefInFrequency = 10000000;
|
||||
static constexpr uint32_t ExtRefOut1Frequency = 10000000;
|
||||
static constexpr uint32_t ExtRefOut2Frequency = 10000000;
|
||||
static constexpr uint32_t SI5351CPLLAlignedFrequency = 832000000;
|
||||
static constexpr uint32_t SI5351CPLLConstantFrequency = 800000000;
|
||||
static constexpr uint32_t FPGAClkInFrequency = 16000000;
|
||||
static constexpr uint32_t DefaultADCSamplerate = 800000;
|
||||
|
|
@ -41,8 +40,12 @@ static constexpr uint32_t DefaultIF2 = 250000;
|
|||
static constexpr uint32_t LO1_minFreq = 25000000;
|
||||
static constexpr uint32_t MaxSamples = 130944;
|
||||
static constexpr uint32_t MinSamples = 16;
|
||||
static constexpr uint32_t PLLRef = 104000000;
|
||||
static constexpr uint32_t PLLRef = 100000000;
|
||||
static constexpr uint32_t BandSwitchFrequency = 25000000;
|
||||
static constexpr uint32_t DefaultLO2 = DefaultIF1 - DefaultIF2;
|
||||
static constexpr uint8_t LO2Multiplier = 13;
|
||||
static constexpr uint32_t SI5351CPLLAlignedFrequency = DefaultLO2 * LO2Multiplier;
|
||||
static constexpr uint16_t DefaultDwellTime = 60;
|
||||
|
||||
static constexpr uint8_t DefaultADCprescaler = FPGA::Clockrate / DefaultADCSamplerate;
|
||||
static_assert(DefaultADCprescaler * DefaultADCSamplerate == FPGA::Clockrate, "ADCSamplerate can not be reached exactly");
|
||||
|
|
@ -84,6 +87,8 @@ static constexpr Protocol::DeviceInfo Info = {
|
|||
.limits_maxAmplitudePoints = Cal::maxPoints,
|
||||
.limits_maxFreqHarmonic = 18000000000,
|
||||
.num_ports = 2,
|
||||
.limits_minDwellTime = 0,
|
||||
.limits_maxDwellTime = 10239,
|
||||
};
|
||||
|
||||
enum class Mode {
|
||||
|
|
@ -127,10 +132,12 @@ namespace Ref {
|
|||
// reference won't change until update is called
|
||||
void set(Protocol::ReferenceSettings s);
|
||||
void update();
|
||||
Si5351C::PLLSource getSource();
|
||||
}
|
||||
|
||||
// Acquisition frequency settings
|
||||
void setAcquisitionFrequencies(Protocol::DeviceConfig s);
|
||||
Protocol::DeviceConfig getDeviceConfig();
|
||||
uint32_t getIF1();
|
||||
uint32_t getIF2();
|
||||
uint32_t getADCRate();
|
||||
|
|
|
|||
|
|
@ -32,13 +32,12 @@ void Manual::Setup(Protocol::ManualControl m) {
|
|||
// Configure LO2
|
||||
if(m.V1.LO2EN) {
|
||||
// Generate second LO with Si5351
|
||||
Si5351.SetCLK(SiChannel::Port1LO2, m.V1.LO2Frequency, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.Enable(SiChannel::Port1LO2);
|
||||
Si5351.SetCLK(SiChannel::Port2LO2, m.V1.LO2Frequency, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.Enable(SiChannel::Port2LO2);
|
||||
Si5351.SetCLK(SiChannel::RefLO2, m.V1.LO2Frequency, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.Enable(SiChannel::RefLO2);
|
||||
|
||||
Si5351.SetPLL(Si5351C::PLL::B, m.V1.LO2Frequency*HW::LO2Multiplier, HW::Ref::getSource());
|
||||
|
||||
// PLL reset appears to realign phases of clock signals
|
||||
Si5351.ResetPLL(Si5351C::PLL::B);
|
||||
} else {
|
||||
|
|
@ -54,8 +53,7 @@ void Manual::Setup(Protocol::ManualControl m) {
|
|||
|
||||
// Configure single sweep point
|
||||
FPGA::WriteSweepConfig(0, !m.V1.SourceHighband, Source.GetRegisters(),
|
||||
LO1.GetRegisters(), m.V1.attenuator, 0, FPGA::SettlingTime::us60,
|
||||
FPGA::Samples::SPPRegister, 0,
|
||||
LO1.GetRegisters(), m.V1.attenuator, 0, FPGA::Samples::SPPRegister, 0,
|
||||
(FPGA::LowpassFilter) m.V1.SourceHighLowpass);
|
||||
|
||||
FPGA::SetWindow((FPGA::Window) m.V1.WindowType);
|
||||
|
|
|
|||
|
|
@ -158,8 +158,7 @@ static void StartNextSample() {
|
|||
|
||||
// only adjust LO2 PLL if necessary (if the deviation is significantly less than the RBW it does not matter)
|
||||
if((uint32_t) abs(LO2freq - lastLO2) > actualRBW / 100) {
|
||||
Si5351.SetCLK(SiChannel::Port1LO2, LO2freq, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.SetCLK(SiChannel::Port2LO2, LO2freq, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.SetPLL(Si5351C::PLL::B, LO2freq*HW::LO2Multiplier, HW::Ref::getSource());
|
||||
lastLO2 = LO2freq;
|
||||
}
|
||||
if (s.UseDFT) {
|
||||
|
|
@ -175,7 +174,7 @@ static void StartNextSample() {
|
|||
|
||||
// Configure the sampling in the FPGA
|
||||
FPGA::WriteSweepConfig(0, trackingLowband, Source.GetRegisters(), LO1.GetRegisters(), attenuator,
|
||||
trackingFreq, FPGA::SettlingTime::us60, FPGA::Samples::SPPRegister, 0,
|
||||
trackingFreq, FPGA::Samples::SPPRegister, 0,
|
||||
FPGA::LowpassFilter::Auto);
|
||||
|
||||
if(firstSample && (signalIDstep == 0)) {
|
||||
|
|
|
|||
|
|
@ -132,6 +132,8 @@ bool VNA::Setup(Protocol::SweepSettings s) {
|
|||
// has to be one less than actual number of samples
|
||||
FPGA::SetSamplesPerPoint(samplesPerPoint);
|
||||
|
||||
FPGA::SetSettlingTime(s.dwell_time);
|
||||
|
||||
// reset unlevel flag if it was set from a previous sweep/mode
|
||||
HW::SetOutputUnlevel(false);
|
||||
// Start with average level
|
||||
|
|
@ -161,9 +163,10 @@ bool VNA::Setup(Protocol::SweepSettings s) {
|
|||
FPGA::WriteMAX2871Default(Source.GetRegisters());
|
||||
|
||||
last_LO2 = HW::getIF1() - HW::getIF2();
|
||||
Si5351.SetCLK(SiChannel::Port1LO2, last_LO2, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.SetCLK(SiChannel::Port2LO2, last_LO2, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.SetCLK(SiChannel::RefLO2, last_LO2, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.Enable(SiChannel::Port1LO2);
|
||||
Si5351.Enable(SiChannel::Port2LO2);
|
||||
Si5351.Enable(SiChannel::RefLO2);
|
||||
Si5351.SetPLL(Si5351C::PLL::B, last_LO2*HW::LO2Multiplier, HW::Ref::getSource());
|
||||
Si5351.ResetPLL(Si5351C::PLL::B);
|
||||
Si5351.WaitForLock(Si5351C::PLL::B, 10);
|
||||
|
||||
|
|
@ -193,9 +196,14 @@ bool VNA::Setup(Protocol::SweepSettings s) {
|
|||
// SetFrequency only manipulates the register content in RAM, no SPI communication is done.
|
||||
// No mode-switch of FPGA necessary here.
|
||||
setPLLFrequencies(freq);
|
||||
if(s.suppressPeaks) {
|
||||
if(needs2LOshift(freq, last_LO2, actualBandwidth, &last_LO2)) {
|
||||
uint32_t new_LO2;
|
||||
auto needs_shift = needs2LOshift(freq, last_LO2, actualBandwidth, &new_LO2);
|
||||
if(needs_shift) {
|
||||
if(s.suppressPeaks) {
|
||||
needs_halt = true;
|
||||
last_LO2 = new_LO2;
|
||||
} else {
|
||||
LOG_WARN("Point at f=%lu%06lu needs an LO shift but the feature is disabled. This will cause a peak.", (uint32_t) (freq/1000000), (uint32_t) (freq%1000000));
|
||||
}
|
||||
}
|
||||
if (last_lowband && !lowband) {
|
||||
|
|
@ -232,7 +240,7 @@ bool VNA::Setup(Protocol::SweepSettings s) {
|
|||
}
|
||||
|
||||
FPGA::WriteSweepConfig(i, lowband, Source.GetRegisters(),
|
||||
LO1.GetRegisters(), attenuator, freq, FPGA::SettlingTime::us60,
|
||||
LO1.GetRegisters(), attenuator, freq,
|
||||
FPGA::Samples::SPPRegister, needs_halt);
|
||||
last_lowband = lowband;
|
||||
}
|
||||
|
|
@ -428,9 +436,7 @@ void VNA::SweepHalted() {
|
|||
// is required to determine the need for a 2.LO shift
|
||||
setPLLFrequencies(frequency);
|
||||
if(needs2LOshift(frequency, last_LO2, actualBandwidth, &last_LO2)) {
|
||||
Si5351.SetCLK(SiChannel::Port1LO2, last_LO2, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.SetCLK(SiChannel::Port2LO2, last_LO2, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.SetCLK(SiChannel::RefLO2, last_LO2, Si5351C::PLL::B, Si5351C::DriveStrength::mA2);
|
||||
Si5351.SetPLL(Si5351C::PLL::B, last_LO2*HW::LO2Multiplier, HW::Ref::getSource());
|
||||
Si5351.ResetPLL(Si5351C::PLL::B);
|
||||
Si5351.WaitForLock(Si5351C::PLL::B, 10);
|
||||
// PLL reset causes the 2.LO to turn off briefly and then ramp on back, needs delay before next point
|
||||
|
|
|
|||
|
|
@ -118,6 +118,7 @@ int main(void)
|
|||
/* Initialize all configured peripherals */
|
||||
MX_GPIO_Init();
|
||||
MX_DMA_Init();
|
||||
MX_I2C2_Init();
|
||||
MX_SPI1_Init();
|
||||
MX_SPI2_Init();
|
||||
MX_UCPD1_Init();
|
||||
|
|
@ -192,7 +193,7 @@ void SystemClock_Config(void)
|
|||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
|
||||
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
|
||||
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV4;
|
||||
RCC_OscInitStruct.PLL.PLLN = 80;
|
||||
RCC_OscInitStruct.PLL.PLLN = 85;
|
||||
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
|
||||
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV4;
|
||||
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
|
||||
|
|
@ -296,7 +297,7 @@ static void MX_I2C2_Init(void)
|
|||
|
||||
/* USER CODE END I2C2_Init 1 */
|
||||
hi2c2.Instance = I2C2;
|
||||
hi2c2.Init.Timing = 0x00F07BFF;
|
||||
hi2c2.Init.Timing = 0x10802D9B;
|
||||
hi2c2.Init.OwnAddress1 = 0;
|
||||
hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
|
||||
hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ extern TIM_HandleTypeDef htim17;
|
|||
void NMI_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN NonMaskableInt_IRQn 0 */
|
||||
|
||||
#define void __weak void
|
||||
/* USER CODE END NonMaskableInt_IRQn 0 */
|
||||
/* USER CODE BEGIN NonMaskableInt_IRQn 1 */
|
||||
while (1)
|
||||
|
|
@ -85,17 +85,17 @@ void NMI_Handler(void)
|
|||
/**
|
||||
* @brief This function handles Hard fault interrupt.
|
||||
*/
|
||||
//void HardFault_Handler(void)
|
||||
//{
|
||||
// /* USER CODE BEGIN HardFault_IRQn 0 */
|
||||
//
|
||||
// /* USER CODE END HardFault_IRQn 0 */
|
||||
// while (1)
|
||||
// {
|
||||
// /* USER CODE BEGIN W1_HardFault_IRQn 0 */
|
||||
// /* USER CODE END W1_HardFault_IRQn 0 */
|
||||
// }
|
||||
//}
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
/* USER CODE BEGIN HardFault_IRQn 0 */
|
||||
#undef void
|
||||
/* USER CODE END HardFault_IRQn 0 */
|
||||
while (1)
|
||||
{
|
||||
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
|
||||
/* USER CODE END W1_HardFault_IRQn 0 */
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Memory management fault.
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ File.Version=6
|
|||
GPIO.groupedBy=Group By Peripherals
|
||||
I2C2.I2C_Speed_Mode=I2C_Fast
|
||||
I2C2.IPParameters=Timing,I2C_Speed_Mode
|
||||
I2C2.Timing=0x00F07BFF
|
||||
I2C2.Timing=0x10802D9B
|
||||
KeepUserPlacement=false
|
||||
Mcu.Family=STM32G4
|
||||
Mcu.IP0=ADC1
|
||||
|
|
@ -338,65 +338,65 @@ ProjectManager.TargetToolchain=STM32CubeIDE
|
|||
ProjectManager.ToolChainLocation=
|
||||
ProjectManager.UnderRoot=true
|
||||
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_I2C2_Init-I2C2-false-HAL-true,5-MX_SPI1_Init-SPI1-false-HAL-true,6-MX_SPI2_Init-SPI2-false-HAL-true,7-MX_UCPD1_Init-UCPD1-false-LL-true,8-MX_USART3_UART_Init-USART3-false-HAL-true,9-MX_USB_PCD_Init-USB-false-HAL-true,10-MX_TIM1_Init-TIM1-false-HAL-true,11-MX_TIM2_Init-TIM2-false-HAL-true,12-MX_ADC1_Init-ADC1-false-HAL-true
|
||||
RCC.ADC12Freq_Value=160000000
|
||||
RCC.AHBFreq_Value=160000000
|
||||
RCC.APB1Freq_Value=160000000
|
||||
RCC.APB1TimFreq_Value=160000000
|
||||
RCC.APB2Freq_Value=160000000
|
||||
RCC.APB2TimFreq_Value=160000000
|
||||
RCC.ADC12Freq_Value=170000000
|
||||
RCC.AHBFreq_Value=170000000
|
||||
RCC.APB1Freq_Value=170000000
|
||||
RCC.APB1TimFreq_Value=170000000
|
||||
RCC.APB2Freq_Value=170000000
|
||||
RCC.APB2TimFreq_Value=170000000
|
||||
RCC.CK48CLockSelection=RCC_USBCLKSOURCE_HSI48
|
||||
RCC.CRSFreq_Value=48000000
|
||||
RCC.CortexFreq_Value=160000000
|
||||
RCC.CortexFreq_Value=170000000
|
||||
RCC.EXTERNAL_CLOCK_VALUE=12288000
|
||||
RCC.FCLKCortexFreq_Value=160000000
|
||||
RCC.FDCANFreq_Value=160000000
|
||||
RCC.FCLKCortexFreq_Value=170000000
|
||||
RCC.FDCANFreq_Value=170000000
|
||||
RCC.FamilyName=M
|
||||
RCC.HCLKFreq_Value=160000000
|
||||
RCC.HCLKFreq_Value=170000000
|
||||
RCC.HSE_VALUE=8000000
|
||||
RCC.HSI48_VALUE=48000000
|
||||
RCC.HSI_VALUE=16000000
|
||||
RCC.I2C1Freq_Value=160000000
|
||||
RCC.I2C2Freq_Value=160000000
|
||||
RCC.I2C3Freq_Value=160000000
|
||||
RCC.I2SFreq_Value=160000000
|
||||
RCC.I2C1Freq_Value=170000000
|
||||
RCC.I2C2Freq_Value=170000000
|
||||
RCC.I2C3Freq_Value=170000000
|
||||
RCC.I2SFreq_Value=170000000
|
||||
RCC.IPParameters=ADC12Freq_Value,AHBFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CK48CLockSelection,CRSFreq_Value,CortexFreq_Value,EXTERNAL_CLOCK_VALUE,FCLKCortexFreq_Value,FDCANFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI48_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,I2SFreq_Value,LPTIM1Freq_Value,LPUART1Freq_Value,LSCOPinFreq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,PLLM,PLLN,PLLPoutputFreq_Value,PLLQ,PLLQoutputFreq_Value,PLLRCLKFreq_Value,PWRFreq_Value,RNGFreq_Value,SAI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,UART4Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USBFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value
|
||||
RCC.LPTIM1Freq_Value=160000000
|
||||
RCC.LPUART1Freq_Value=160000000
|
||||
RCC.LPTIM1Freq_Value=170000000
|
||||
RCC.LPUART1Freq_Value=170000000
|
||||
RCC.LSCOPinFreq_Value=32000
|
||||
RCC.LSE_VALUE=32768
|
||||
RCC.LSI_VALUE=32000
|
||||
RCC.MCO1PinFreq_Value=16000000
|
||||
RCC.PLLM=RCC_PLLM_DIV4
|
||||
RCC.PLLN=80
|
||||
RCC.PLLPoutputFreq_Value=160000000
|
||||
RCC.PLLN=85
|
||||
RCC.PLLPoutputFreq_Value=170000000
|
||||
RCC.PLLQ=RCC_PLLQ_DIV4
|
||||
RCC.PLLQoutputFreq_Value=80000000
|
||||
RCC.PLLRCLKFreq_Value=160000000
|
||||
RCC.PWRFreq_Value=160000000
|
||||
RCC.PLLQoutputFreq_Value=85000000
|
||||
RCC.PLLRCLKFreq_Value=170000000
|
||||
RCC.PWRFreq_Value=170000000
|
||||
RCC.RNGFreq_Value=48000000
|
||||
RCC.SAI1Freq_Value=160000000
|
||||
RCC.SYSCLKFreq_VALUE=160000000
|
||||
RCC.SAI1Freq_Value=170000000
|
||||
RCC.SYSCLKFreq_VALUE=170000000
|
||||
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
|
||||
RCC.UART4Freq_Value=160000000
|
||||
RCC.USART1Freq_Value=160000000
|
||||
RCC.USART2Freq_Value=160000000
|
||||
RCC.USART3Freq_Value=160000000
|
||||
RCC.USART1Freq_Value=170000000
|
||||
RCC.USART2Freq_Value=170000000
|
||||
RCC.USART3Freq_Value=170000000
|
||||
RCC.USBFreq_Value=48000000
|
||||
RCC.VCOInputFreq_Value=4000000
|
||||
RCC.VCOOutputFreq_Value=320000000
|
||||
RCC.VCOOutputFreq_Value=340000000
|
||||
SH.GPXTI1.0=GPIO_EXTI1
|
||||
SH.GPXTI1.ConfNb=1
|
||||
SH.S_TIM2_CH1.0=TIM2_CH1,PWM Generation1 CH1
|
||||
SH.S_TIM2_CH1.ConfNb=1
|
||||
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_4
|
||||
SPI1.CalculateBaudRate=40.0 MBits/s
|
||||
SPI1.CalculateBaudRate=42.5 MBits/s
|
||||
SPI1.DataSize=SPI_DATASIZE_8BIT
|
||||
SPI1.Direction=SPI_DIRECTION_2LINES
|
||||
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler,DataSize
|
||||
SPI1.Mode=SPI_MODE_MASTER
|
||||
SPI1.VirtualType=VM_MASTER
|
||||
SPI2.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_4
|
||||
SPI2.CalculateBaudRate=40.0 MBits/s
|
||||
SPI2.CalculateBaudRate=42.5 MBits/s
|
||||
SPI2.DataSize=SPI_DATASIZE_8BIT
|
||||
SPI2.Direction=SPI_DIRECTION_2LINES
|
||||
SPI2.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler,DataSize
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue