gs001588 发表于 2022-1-10 20:49

【国产FPGA高云GW1N-4系列开发板测评】——10、OSC抖动与rPLL抖动和偏差的疑惑?

本帖最后由 gs001588 于 2022-1-10 21:20 编辑

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;【国产FPGA高云GW1N-4系列开发板测评】&mdash;&mdash;10、OSC抖动与rPLL抖动和偏差的疑惑</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;上一贴中提到,用两种方法&mdash;&mdash;使用外部CLK_50M时钟和rPLL生成的CLK_50M2分别来测试内部OSC时钟,得到的结果有差别。那么其中必有一种测量是不准的,为什么会出现这种结果呢,上示波器对各个时钟分别测试。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;(上一贴地址:<a href="https://bbs.eeworld.com.cn/thread-1191437-1-1.html" target="_blank">【国产FPGA高云GW1N-4系列开发板测评】&mdash;&mdash;9、内部OSC和rPLL的IP核测试 https://bbs.eeworld.com.cn/thread-1191437-1-1.html</a>&nbsp;)</span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;为了测试时钟,将外部晶振时钟CLK_50M经FPGA内部回环后输出到Pin75管脚,rPLL产生的50MHz时钟CLK_50M2输出到Pin76管脚,将OSC时钟CLK_OSC1输出到Pin78管脚。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;"></span></span></p>

<p>&nbsp;</p>

<p><font face="宋体"><span style="font-size: 16px;">&nbsp; &nbsp;用示波器测量</span></font><span style="font-size:16px;"><span style="font-family:宋体;">Pin75管脚波形,时钟抖动很小,频率非常稳定,49.9996MHz。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;"></span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;</span></span><font face="宋体"><span style="font-size:16px">用示波器测量</span></font><span style="font-size:16px"><span style="font-family:宋体">Pin76管脚波形,时钟抖动稍大,频率为49.6817MHz,频率有跳动,从49.6813到49.36843之间变化。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;"></span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;再次测量Pin76管脚波形,频率为49.6834MHz。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;"></span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;</span></span><font face="宋体"><span style="font-size:16px">用示波器测量</span></font><span style="font-size:16px"><span style="font-family:宋体">Pin78管脚波形,时钟抖动较大,频率大约为102.968MHz。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;"></span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;从以上对三种时钟的测量,得出结论,上一贴中对OSC时钟测量,使用外部晶振时钟CLK_50M的方法是正确的(即内部OSC时钟为206MHz)。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;可以看出,经rPLL产生的50MHz时钟CLK_50M2实际频率与理论值存在偏差,1 - 49.68/50.00 = 0.64%。1 / 0.64% = 156.25s,大约每156秒CLK_50M2的LED灯LED3秒闪次数就会比CLK_50M的LED1少一拍,实际用秒表计时与计算时间一致。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;不清楚rPLL原理,产生的时钟为什么会有抖动,为什么会产生时钟频率偏差?</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;内部的OSC时钟又是什么情况,为什么也会有抖动?</span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;自动模式运行逻辑分析仪,按一次RESET复位键(已通过双功能IO设置,将默认的Reconfig_n功能,改为了通过IO,用作复位功能),开始抓取逻辑分析仪波形。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;COUNTER为CLK_50M的秒时钟计数,COUNTER1为CLK_50M2的时钟计数,COUNTER2为CLK_OSC1时钟计数。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;抓取波形1,可以看到COUNTER与COUNTER2值稳定,COUNTER1的值稍往后偏。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;"></span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;抓取波形2,COUNTER与COUNTER2值依然稳定,COUNTER1的值两次往后偏。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;"></span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;抓取波形3,COUNTER与COUNTER2值依然稳定,COUNTER1的值两次往后偏。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;"></span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;大约150S后,抓取波形4,可看到COUNTER1的值已经快要落后COUNTER一个秒计数周期。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;"></span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;抓取波形5。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;"></span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;抓取波形6,最终COUNTER1的值已经落后COUNTER一个秒计数周期。</span></span></p>

<p><span style="font-size:16px;"><span style="font-family:宋体;"></span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;(最初怀疑内部rPLL的输入时钟可能会有问题,修改工程,将Pin75输出的时钟通过Pin106的PLL时钟专用管脚输入,测试结果与之前相同,排除了输入时钟不稳的因素。)</span></span></p>

<p>&nbsp;</p>

<p><span style="font-size:16px;"><span style="font-family:宋体;">&nbsp; &nbsp;本实验工程文件附件:</span></span></p>

<p><br />
&nbsp;</p>

gs001588 发表于 2022-1-10 22:18

rPLL输出准确频率时钟

本帖最后由 gs001588 于 2022-1-11 12:16 编辑

<p>&nbsp;</p>

<p><span style="font-size: 16px; font-family: 宋体; color: rgb(0, 0, 0);">&nbsp; &nbsp;需要使用高级模式,对三个参数进行调整,这三个系数字面意思都是分频系数,有点懵。经过摸索,在下图中对三个系数做了编号,实际1对应分频系数,2对应倍频系数,3对应频率微调。通过自动计算,3的值推荐为16时,频率就如主贴中的有偏差;手动将3值改为8后,实测频率为50MHz。</span></p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;"></span></span></span></p>

<p>&nbsp;</p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;">&nbsp; &nbsp;分别对应例化模型文件中的IDIV_SEL、FBDIV_SEL、ODIV_SEL。</span></span></span></p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;"></span></span></span></p>

<p>&nbsp;</p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;">&nbsp; &nbsp;在文件&ldquo;UG286.pdf&mdash;&mdash;Gowin时钟资源(Clock)用户指南&rdquo;中找到对应内容如下。</span></span></span></p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;"></span></span></span></p>

<p>&nbsp;</p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;">&nbsp; &nbsp;对系数解释如下。(基本等于没说,没有更详细的解释)</span></span></span></p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;"></span></span></span></p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;">&nbsp; &nbsp;修改后的CLK_50M2与CLK_50M频率完全一致,计数器值可以同步。</span></span></span></p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;"></span></span></span></p>

<p>&nbsp;</p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;">&nbsp; &nbsp;长时间测试,CLK_50M2频率稳定</span></span></span></p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;"></span></span></span></p>

<p>&nbsp;</p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;">&nbsp; &nbsp;用示波器测量CLK_50M2频率,稳定为49.9996MHz。虽然还是有抖动,但至少频率是没问题了。</span></span></span></p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;"></span></span></span></p>

<p>&nbsp;</p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;">&nbsp; &nbsp;同样方法,将逻辑分析仪采集时钟CLK_100M的倍频系数(系数2 FBDIV_SEL)改为2,频率微调系数(系数3 ODIV_SEL)手动改为4,即可实际精确的100MHz输出频率。</span></span></span></p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;"></span></span></span></p>

<p>&nbsp;</p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;">&nbsp; &nbsp;将CLK_100M输出到Pin79脚,用示波器观察测量信号,频率非常精确99.9993MHz。</span></span></span></p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;"></span></span></span></p>

<p>&nbsp;</p>

<p><span style="color:#000000;"><span style="font-family:宋体;"><span style="font-size:16px;">&nbsp; &nbsp;至此,可以使用rPLL输出准确频率的时钟。如果大家在使用rPLL时遇到类似问题,不妨试试高级模式。</span></span></span></p>

<p>&nbsp;</p>
页: [1]
查看完整版本: 【国产FPGA高云GW1N-4系列开发板测评】——10、OSC抖动与rPLL抖动和偏差的疑惑?