creativelau / mini-dso Goto Github PK
View Code? Open in Web Editor NEW用STC单片机制作的简易示波器 / DIY Mini Digital Storage Oscilloscopes(DSO) with STC MCU
License: MIT License
用STC单片机制作的简易示波器 / DIY Mini Digital Storage Oscilloscopes(DSO) with STC MCU
License: MIT License
小白一个,想请教一下,限制这个示波器采样频率不能过高的原因都有哪些?
如题
老刘你好,我在学习您的示波器代码的时候对以下几个计算公式感到了一些困惑,它们没有数学公式的说明,难以理解这样处理的缘由,希望您能给予解答。
问题1:在chart.c的AnalyseData()函数中,处理当前选择Option_MeaWay_AC方式进行测量的处理中,对DC输入您是用Mvoltage_Aver += (VMax_m + VMin_m) >> 1
进行处理,但是AC部分却做了如下复杂计算,这个计算的依据是什么?
问题2:回头再看VMax_m
和VMin_m
,它们同样经过了一些处理,除此之外,它们是通过adcMax-BiasVoltage
以及adcMin-BiasVoltage
转换得到,BiasVoltage
默认值为8900
我原来猜测是4092满量程的偏移,但这个值还是让我感到困惑。
问题3:关于频率计算方面,您给了一个 25000 or 25000000
这个基准值为什么这么选取?是与缓存大小相关吗?
switch (ScaleH)
{
case 0: //500ms
WaveFreq = 50.0f / (float)WaveLength + 0.5; //WaveFreq=25000/(500*WaveLength);
break;
case 1: //200ms
WaveFreq = (125.0f / (float)WaveLength); //WaveFreq=25000/(200*WaveLength);
break;
case 2: //100ms
WaveFreq = (250.0f / (float)WaveLength); //WaveFreq=25000/(100*WaveLength);
break;
case 3: //50ms
WaveFreq = (500.0f / (float)WaveLength); //WaveFreq=25000/(50*WaveLength);
break;
case 4: //20ms
WaveFreq = (1250.0f / (float)WaveLength); //WaveFreq=25000/(20*WaveLength);
break;
case 5: //10ms
WaveFreq = (2500.0f / (float)WaveLength); //WaveFreq=25000/(10*WaveLength);
break;
case 6: //5ms
WaveFreq = (5000.0f / (float)WaveLength); //WaveFreq=25000/(5*WaveLength);
break;
case 7: //2ms
WaveFreq = (12500.0f / (float)WaveLength); //WaveFreq=25000/(2*WaveLength);
break;
case 8: //1ms
WaveFreq = (25000.0f / (float)WaveLength); //WaveFreq=25000/(1*WaveLength);
break;
case 9: //500us
WaveFreq = (50000.0f / (float)WaveLength); //WaveFreq=25000000/(500*WaveLength);
break;
case 10: //200us
WaveFreq = (125000.0f / (float)WaveLength); //WaveFreq=25000000/(200*WaveLength);
break;
case 11: //100us
WaveFreq = (250000.0f / (float)WaveLength); //WaveFreq=25000000/(100*WaveLength);
break;
}
WaveFreq = (float)WaveFreq / (0.0162f * (log10(WaveFreq) /log10(2.7) ) + 0.9398f);
@CreativeLau 谢谢!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.