完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
这就是问题:我需要产生一个517 OCH 517kHz信号,正弦或平方。要做到这一点,最简单的方法就是用计时器来划分时钟。这需要零CPU周期。问题是你最终会有一个非常奇怪的晶体频率。做DDS是软件会消耗太多的时钟周期。使用外部DDS芯片绝对是一种选择。我在这里问的原因是因为你有大量的知识,所以有很多是我监督的一个简单的把戏?PIC是一个DSPIC30
以上来自于百度翻译 以下为原文 This is the problem: I need to generate a 517 och 517kHz signal, sine or square. The easy way to do this is to divide down the clock, using a timer. This takes zero cpu cycles. Problem is that you end up with a very odd crystal frequency. Doing DDS is software will eat up too many clock cycles. Using an external DDS-chip is definitely an option. Reason I asking here is because you have a great wealth of knowledge so there many be an easy trick that I am overseeing? PIC is a dsPIC30 |
|
相关推荐
13个回答
|
|
你尝试过使用PWM吗?根据PIC在使用中,你可以得到非常精确的…或者,如果抖动不是(大)问题,你可以使用中断平均两个频率。
以上来自于百度翻译 以下为原文 Did you try using PWM? Depending on the PIC in use, you can get very precise... Or, if jitter is not a (big) problem, you could average two frequencies using an interrupt. |
|
|
|
我可能是密集的,但不是PWM总是时钟除以整数因子?我有一个预分频器,然后一个周期寄存器。所以如果我有一个20MHz的频率,需要517kHz,我需要除以38.6847。
以上来自于百度翻译 以下为原文 I might be dense, but is not PWM always the clock divided by an integer factor? Ie I have a prescaler and then a period register. So if I have a Tcy of 20MHz and want 517kHz, I need to divide by 38.6847 |
|
|
|
嗯,是的。这就是为什么我建议“平均”的方法:以38和39交替地快速排序。
以上来自于百度翻译 以下为原文 Well, yes. That's why I suggested the "average" method: divide alternatively by 38 and 39 in rapid sequence |
|
|
|
好啊。我明白了,但这可能不如本地振荡器信号好。猜测使用DDS芯片是最容易的。这也将有利于微调的好处。
以上来自于百度翻译 以下为原文 OK. I see, but that would probably not play well as a Local Oscillator signal. Guess it is easiest to use a DDS chip. That will also have the advantage of allowing fine-tuning. |
|
|
|
这是一个点,我用了一些DDS从模拟,他们是相当不错,是的。
以上来自于百度翻译 以下为原文 That's a point I used some DDS from Analog and they're quite nice, yep. |
|
|
|
对。我甚至有一个焊接到DIP适配器自从我建立了一个基于PIC的信号发生器很多年前。或最简单的我可以找到,AD9833准备焊接板上四美元…
以上来自于百度翻译 以下为原文 Yes. I even have one soldered to a DIP adapter ever since I built a PIC-based signal generator many years ago. Or the simplest I can find, AD9833 ready soldered on a board for four dollars... |
|
|
|
但是,你有没有看NCO和DSM模块里面的“新”PIC16?大约2年前我在DDS之前试过
以上来自于百度翻译 以下为原文 But, did you take a look at NCO and DSM modules inside "new" PIC16? I tried them just before the DDS, some 2 years ago |
|
|
|
我认为这与38/39计数有类似的问题,因为它会引起517kHz的频谱展宽。
以上来自于百度翻译 以下为原文 I think that would have a similar issue to the 38/39 count in that it would cause jitter which spreads the spectrum of the 517kHz |
|
|
|
嗯,是的,但是** DDS设备不是这样工作的吗?差别可能在于它的分辨率,而且它们通常可以达到24位。
以上来自于百度翻译 以下为原文 Well, yes: but doesn't *any* DDS device work like that? The difference might be in its resolution, and they often get up to 24bits |
|
|
|
嗯,不完全是这样。有差异,DDS动物更倾向于通信和此类。不过它们是互相交流的生物。DSM不能根据我所看到的创建任意频率。NCO可以。
以上来自于百度翻译 以下为原文 Well, not quite. There are differences and the DDS-animals are more geared towards comunications and such. They are intereting creatures though. The DSM cannot create an an arbitrary frequency from what I can see. The NCO can. |
|
|
|
嗯,是的,的确如此。至于DSM,我似乎记得有人建议把2种混合起来以增加灵活性。
以上来自于百度翻译 以下为原文 Well, yes, indeed. As for DSM, I seem to remember that somebody suggested mixed the 2 for more flexibility |
|
|
|
具有电机控制的PIC PWM模块可以很好地将方波边缘放置在系统中最高频率时钟(振荡器W/PLLX16,约100MHz)的任何边缘上。因为你可以在每一个PWM边缘得到一个中断,并且在PWM计数限制的变化下对它作出响应,你可以以几乎任意的模式来完成这一点,所以在很长的一段时间内(比如说1秒),边缘的数量和你的晶体振荡器一样精确。尽管如此,很难知道需要什么来满足你的需求。
以上来自于百度翻译 以下为原文 PIC PWM modules with motor control can do quite fine things with placing square wave edges pretty much on any edge of the highest frequency clock (oscillator w/ PLLx16, about 100MHz) in the system. And since you can get an interrupt on every PWM edge, and respond to it with a change in the PWM count limits, you can do this in a nearly arbitrary pattern, so over a long period (say 1 second) the number of edges is as accurate as your crystal oscillator. Without knowing what you are doing with the output, though, it's hard to know what's required to meet your needs. |
|
|
|
然而,不知道你在用输出做什么,很难知道需要什么来满足你的需要。要非常具体:产生518kHz的LO,而解码1kHz,如果与FSK。所以,我真的不想让CPU负担过重。因此,中断是不幸的。所以在现实中,我所能想到的就是使用计时器来划分时钟,这就导致了非常奇特的时钟频率。最后,我使用了AD983X DDS。
以上来自于百度翻译 以下为原文 Without knowing what you are doing with the output, though, it's hard to know what's required to meet your needs.True. To be very specific: To generate a 518kHz LO whilst decoding a 1kHz IF with FSK. So, I really do not want to burden the CPU at all. So interrupts are out, unfortunately. So in reality, all I gave been able to come up with is to use a timer to divide the clock, which unfortunately leads to extremely odd clock frequencies. In the end, I used an AD 983x DDS. |
|
|
|
只有小组成员才能发言,加入小组>>
5170 浏览 9 评论
2001 浏览 8 评论
1931 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3176 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2228 浏览 5 评论
737浏览 1评论
622浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
509浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
635浏览 0评论
531浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 22:34 , Processed in 1.570744 second(s), Total 102, Slave 85 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号