完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
大家好!我正忙于设计一个波形发生器来产生基本的信号,比如正弦、SAW、tiL和SQL。我只想在我的设置上输入一些。我正在考虑使用PIC18来完成除了产生信号以外的所有任务。这包括管理LCD,旋转编码器,数字电位器和按钮。我将让PIC24输出位配置到我的电阻梯形(DAC)来产生信号。我想我可以通过UART或一些东西从PIC18发送命令。我选择了这样做,所以我可以得到一个数兆赫兹的信号,因为PIC24不必浪费时间刷新CD或轮询I/O引脚。不过,这感觉就像是浪费了PIC24。有什么想法吗?谢谢你的帮助!
以上来自于百度翻译 以下为原文 Hello everyone! I'm busy designing a waveform generator to produce basic signals like sine, saw, tri and sq. I just wanted some input on my setup. I am considering using a pic18 for all tasks other than producing signal. That includes managing the LCD, rotary encoders, digital potentiometers and push buttons. I was going to have the pic24 output the bit configurations to my resistor ladder(DAC) to produce the signal. I figure I could send it commands from the pic18 via UART or something. I chose this so I could get a signal of several Mhz as the pic24 would not have to waste time refreshing the LCD or polling the I/O pins. Still, it feels like a waste of pic24. Any thoughts? I appreciate your help! |
|
相关推荐
19个回答
|
|
|
我看不出PIC24有什么需要。PIC18的运行速度有多快,你想在DAC上使用什么样的采样率?
以上来自于百度翻译 以下为原文 I don't see any need for the PIC24. How fast will your PIC18 be running, and what sampling rate do you want to use on your DAC? |
|
|
|
|
|
我想把PIC18的时钟和内部RC时钟一样快,我相信这是64兆赫。我希望能以高达几个兆赫的采样率,但我没有任何预期的速率。我正在使用一个12位的R 2R电阻梯和一个运算放大器,所以它也将取决于。我有28针PDIP,所以I/O引脚的数量我也可以关注。
以上来自于百度翻译 以下为原文 I'm trying to clock the PIC18 as fast as the internal RC clock will go which I believe is 64 Mhz. I was hoping to go as high as several Mhz for the sampling rate but I do not have any intended rate. I am using a 12 bit r-2r resistor ladder and an opamp so it will depend on that as well. I have the 28 pin PDIP so the number of I/O pins I have available is also of concern. |
|
|
|
|
|
|
|
|
|
|
|
我很抱歉,我很模糊。我买了PIC18F26K40,已经通过SPI、1旋转编码器和1按钮安装了LCD。我担心的是,因为LCD和其他I/O引脚执行任务所需的时间,我将不能获得足够快的频率用于我的信号。我知道PIC24可以用PLL达到96MHz。也许这将是一个更好的选择,包括在一个MCU这一切?
以上来自于百度翻译 以下为原文 I'm sorry for being so vague. I bought the PIC18F26K40 and have already setup the LCD via SPI, 1 rotary encoder and 1 push button. My concern is that because of the time it will take to perform tasks for the LCD and other I/O pins, I wont be able to get a fast enough frequency for my signals. I know the PIC24 can hit up to 96Mhz with PLL. Maybe that will be a better option to include all this in one MCU? |
|
|
|
|
|
一个PIC18每指令周期有4个时钟,所以你只能在16MHz执行指令,所以你不会得到两个MHz的输出。一个PIC18FXXK42有两个DMA通道,这将有很大帮助,但可能还不够。PIC24每指令周期有2个时钟,所以用一个96 MHz的时钟,你是E。XECUIT在48兆赫,三次更好。一些PIC24S有DMA,但是你没有提到你在看什么。
以上来自于百度翻译 以下为原文 A PIC18 has 4 clocks per instruction cycle, so your only executing instructions at 16MHz, so you're not going to get a couple of MHz output. A PIC18FxxK42 has two DMA channels, which would help a lot, but probably not enough. A PIC24 has 2 clocks per instruction cycle, so with a 96 MHz clock you're executing at 48MHz, three time better. Some PIC24s have DMA, but you didn't mention which you're looking at. |
|
|
|
|
|
我有PIC24FJ256GA702。它确实有DMA功能。这就是为什么我认为最好用PIC24来产生信号和PIC18,但这似乎是一种浪费。也许使用PLC24和DMA的PIC24将足以达到几个MHz信号?我道歉,如果我没有给出足够的细节。我仍然在努力解决问题。编辑:但是,考虑到LCD使用的延迟,我认为即使这样也不够。
以上来自于百度翻译 以下为原文 I have the PIC24FJ256GA702. It does have DMA capabilities. Right. That's why I figured it would be best if I use the Pic24 for generating the signal and pic18 for everything else. But it seems like a waste. Perhaps using the pic24 with its PLL and DMA will be enough to get up to a few Mhz signals? I apologize if I'm not giving enough details. Im still trying to figure things out as I go along. Edit: Still, thinking about the delays used for the LCD makes me think that even that wont be enough. |
|
|
|
|
|
如果输出由DMA处理,并且在DMA完成触发的中断服务中重新启动DMA,那么与非中断代码中的延迟无关。
以上来自于百度翻译 以下为原文 If the output is handled by DMA, and you restart the DMA in an interrupt service triggered by the DMA finishing, then it's irrelevant what delays you have in your non-interrupt code. |
|
|
|
|
|
要获得指定格式的几个MHz信号,您需要最少20 MSPS采样率。您可以用更快的PIC24(如PIC24HJ,甚至PIC24EP,它可以运行在70 MHz)来实现这一点。在PIC18上,假设您可以每5个指令提供一个新的DAC值到一个并行DAC(您不能做得比这更好),您只能得到3MSPS采样率,这对于信号FR来说可能是可以的。如果你需要你的信号的形状精确,那么你需要更高的采样率——信号频率的50X/100X倍。另外,你需要相应的模拟带宽。异常可能是正弦波——带宽有限,一切看起来都像正弦波,但不会很精确。
以上来自于百度翻译 以下为原文 To get few MHz signal of a specified form, you'll need at the very least 20 Msps sample rate. You may be able to accomplish this with faster PIC24 (such as PIC24HJ or even PIC24EP which can run at 70 MHz). On PIC18, assuming you can supply a new DAC value every 5 instructions to a parallel DAC (you cannot do better than this), you can only get 3Msps sample rate which might be ok for signal frequencies up to about 300 (possibly 500) kHz. If you need the shape of your signals to be precise, you'll need much higher sample rates - 50x/100x times of the signal frequency. Also, you will need the corresponding analog bandwidth. The exception is probably a sine wave - with limited bandwidth everything will look like a sine wave, but it won't be very precise. |
|
|
|
|
|
您可能希望使用SPI DAC而不是R 2R网络。我找到了一个12位乘法的DAC,具有高达50 MHz时钟的SPI串行接口,它可以产生大约6米的波形:大约6美元:HTTP://www. Ti.COM/LIT/DS/SIMLKY/DAC7811PDA:一个四元版本的12美元:HTTPS://www. Mous.COM/DS/2/609/AD5686RY5685 RY5684R-78855.PDFANOODER方法是将波形存储在外部RAM中,并使用时钟来循环通过这些值。大多数RAM芯片将是8位,但这可能是足够好的。一个波形的完整周期可以存储在256个字节中,所以一个64 MHz的时钟将产生一个250 kHz的波形,但是你可以用64个字节为1 MHz或16个字节为4 MHz。你也可以得到一个波形发生器IC,它提供正弦、正方形和三角波,大约4美元:HTTPS://www. Mous.COM/DS/。2/609/AD9834-88159PDF
以上来自于百度翻译 以下为原文 You might want to use an SPI DAC rather than the R-2R network. I found a 12 bit multiplying DAC with SPI serial interface with up to 50 MHz clock, which might be able to produce waveforms up to 3 M Samples/sec, for about $6: http://www.ti.com/lit/ds/symlink/dac7811.pdf or a quad version for $12: https://www.mouser.com/ds/2/609/AD5686R_5685R_5684R-748859.pdf Another method is to store waveforms in an external RAM and use a clock to cycle through the values. Most RAM chips will be 8 bit, but that may be good enough. A full cycle of a waveform could be stored in 256 bytes, so a 64 MHz clock would produce a 250 kHz waveform, but you could use 64 bytes for 1 MHz or 16 bytes for 4 MHz. You can also get a waveform generator IC that will provide sine, square, and triangle waves,for about $4: https://www.mouser.com/ds/2/609/AD9837-878159.pdf |
|
|
|
|
|
因此,如果我使用DMA通过ISR将特定的端口配置到特定的端口上,那么我就有可能在PIC24上运行所有的设备,并且仍然可以达到信号的几个MHz。这听起来非常可行。我自己也不会想到这一点。非常感谢你,Qub。我知道你在我的另一个岗位上帮了我的忙。我非常感谢你的帮助!
以上来自于百度翻译 以下为原文 So if I use the DMA to put out the various bit configuration I need onto a specific port via an ISR, then I could potentially run everything on the pic24 and still go up to several MHz of a signal. That sounds very feasible. I would never have come up with this myself. Thank you so much Qub. I know you helped me on another one of my posts. I really appreciate your help! |
|
|
|
|
|
看看这个:HTTP://www. McCHIP.COM/FUMMS/M1024227.ASPX
以上来自于百度翻译 以下为原文 Take a look at this too: http://www.microchip.com/forums/m1024227.aspx |
|
|
|
|
|
嘿,各位,我突然有一个问题要回复。我一直收到一个被允许拒绝的消息,并给管理员发了电子邮件。所以如果我不回复你的回复,请你知道我已经读过并思考过了。一旦管理员帮助我,我会回应。再次感谢所有的帮助。这真的帮助了我。[编辑]:我不知道这是如何通过,但这是在几次失败的尝试。我可以很好地编辑。[编辑2 ]:我可以使用页面底部的QueChror部分。奇怪的。。。
以上来自于百度翻译 以下为原文 Hey Everyone, I am having a lot of trouble replying to posts all of a sudden. I keep getting a permission denied message and have emailed the admin. So if I don't reply to your response, please know I have read it and thought about it. As soon as the admin helps me out, Ill respond. Thank you again for all your help guys. This really helped me out. [Edit]: I'm not sure how this one went through but this was after several unsuccessful attempts. I can edit just fine oddly enough. [Edit 2]: It seems I can use the quickReply section at the bottom of the page fine. Weird... |
|
|
|
|
|
是的。我注意到后邮报6,一个96MHz时钟会给你48 MHz的指令速率。
以上来自于百度翻译 以下为原文 Yes. I noted back post#6 that a 96MHz clock would give you a 48 MHz instruction rate. |
|
|
|
|
|
谢谢你的回复。这有助于我理解我需要满足的要求来获得我想要的信号。现在我再购买另一个PIC24是不可行的。正如Qub推荐的,我将使用PLL和DMA尝试我的PIC24,看看我能得到的信号有多快。
以上来自于百度翻译 以下为原文 Thanks for your response. This helps me understand the requirements I am going to need to meet to get the signals I want. It is not feasible for me to buy another pic24 right now. As Qub recommended, I will try my PIC24 using the PLL and DMA and see how fast a signal I can get. |
|
|
|
|
|
谢谢你的建议。我想我可以在我的PIC24(16kByter)上使用SRAM来存储波形。我一定会调查的!我知道我可以使用很多IC,但我以前从来没有做过DAC。我想试试看,认为电阻梯子是最好的。
以上来自于百度翻译 以下为原文 Thank you for this advice. I suppose I could use the SRAM on my pic24( 16Kbytes ) to store the waveforms. I will definitely look into it! I know there are a lot of IC's I can use but Ive never made a DAC before. I wanted to take a crack at it and figured a resistor ladder would be best. |
|
|
|
|
|
DAC概念简单,但使用了很多组件。8位DAC需要匹配0.4%或更好的电阻器。如果将波形存储在PIC的RAM中,则需要将其值输出到8位端口。我不熟悉DMA模块,但它看起来可以读取RAM中存储的波形数据并将其传输到GPIO端口,但这似乎需要每个传输的中断。如果波形存储在16个字节中,并且可以以1 MHz的速率来服务定时器中断,那么将产生62.5 kHz的波形。为了产生一个1 MHz的信号,你需要一个16 MHz的定时中断,而一个48 MHz的指令速率只允许对ISR.HTPSP//E.WiKiTo.Org/WiKi/ReloRoordLaDeldRead三个指令。如果你使用一个7HC4040,你可以在16 MHz时对它进行计时,并使用12个可用的8位来提供地址。到一个静态RAM,如CY7C185(20毫秒),其8个数据位可以驱动DAC。你可以使用一个V/F转换器提供一个可调时钟,乘法DAC允许可调电压。你甚至可以使用一个快的EEPROM,像AT28 HC64 B,它是70纳秒,但它只能达到14 MHZ。HTPSP//www. Mous.com /DS/2/268/DOC0244-115092.PDFI找到一个高速计数器,它可以在140兆赫时钟:HTTPS://www. Mous.COM/DS/2/308/MC7AC4040-D-108181.PDF
以上来自于百度翻译 以下为原文 A DAC is conceptually simple but uses a lot of components. An 8 bit DAC needs resistors matched to 0.4% or better. If you store the waveform in the PIC's RAM, you will need to output its value to an 8 bit port. I am not familiar with the DMA module, but it looks like it can read waveform data stored in RAM and transfer it to a GPIO port, but that appears to require an interrupt for each transfer. If a waveform is stored in 16 bytes, and a timer interrupt can be serviced at a rate of 1 MHz, that will generate a waveform at 62.5 kHz. To generate a 1 MHz signal you would need a timer interrupt at 16 MHz, and a 48 MHz instruction rate would allow only three instructions for the ISR. https://en.wikipedia.org/wiki/Resistor_ladder If you use a 74HC4040 you can clock it at 16 MHz and use 8 bits of the 12 available to provide addresses to a static RAM like CY7C185 (20 nSec), and its 8 data bits can drive a DAC. You can use a V/F converter to provide an adjustable clock, and a multiplying DAC allows adjustable voltage. You could even use a fast EEPROM like the AT28HC64B which is 70 nSec, but it can only do up to 14 MHz. https://www.mouser.com/ds/2/268/doc0274-1115092.pdf I found a high speed counter that can be clocked at 140 MHz: https://www.mouser.com/ds/2/308/MC74AC4040-D-108181.pdf |
|
|
|
|
|
DMA只需要在传输结束时中断(例如在N字节之后)。但关键是确保下一次转移是及时设置的。乒乓球模式。
以上来自于百度翻译 以下为原文 The DMA would only require an interrupt at the end of the transfer (e.g. after n bytes). But the key would be to ensure the next transfer is setup in time... Ping pong mode. |
|
|
|
|
|
|
|
|
|
|
|
呃……我认为我正确的说PIC24FJ256GA702只适用于16MIPS。与USB 96MHz有一些混淆吗?DMA在这些早期图片只适合于“DMA准备就绪”外围设备。在内存空间中任何地方都不可能“DMA”…抱歉,可能需要重新思考……(@ PStechPaul,虽然您对故障有正确的认识,但问题与电阻器的切换有关,而不是二进制数本身)。
以上来自于百度翻译 以下为原文 Errr.... I think I am correct in saying the PIC24FJ256GA702 is only good for 16Mips. Is there some confusion with the USB 96MHz ? Also DMA on these early pics are only suitable for 'DMA ready' peripherals. It is not possible to 'DMA' anywhere in the memory space... Sorry, there maybe a re-think needed ... (@ PStechPaul Although you are correct about the glitches, the problem is associated with the switching of the resistors and not the binary number itself) |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1121浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
872浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 20:22 , Processed in 1.229482 second(s), Total 110, Slave 92 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1415