完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,在我的项目中,我使用的是一个DSPIC33 EP64 MC202,它运行良好,但是,我怀疑我做的事情是正确的。我想避免未来的惊喜。我不知道该怎么做电路和如何配置它。电路:在图OSC1OSC2.JPG,在附件,是我的两个版本的振荡器的CRCUIT。在我的设计中,我使用了第一个版本,没有1M欧姆电阻。第二个版本是我认为正确的版本。CRISTAL是一个15MHz(15000 0H5M)的FiuSrave:最初,我做了一个配置,在一个分离的文件中,在没有外部振荡器的情况下启动:在初始化之后,我配置了我的设备,改变了振荡器的频率和ChsSe外部振荡器:疑惑:1)我的第一个问题是,一个是电路的正确版本?2)我的代码是否正确?即使第二个版本是正确的版本?(记住我的代码是基于电路的第一个版本,没有电阻器)任何帮助都将非常感激。
以上来自于百度翻译 以下为原文 Hello all, In my project I'm using a dsPIC33EP64MC202, and it is working fine, however, I have a doubt if I'm doing things the right way. I want to avoid surprises in the future. I'm in doubt how to do the circuit and how to configure it. Circuit: In the figure osc1osc2.jpg, at the attachments, are my two versions of the oscilator's crcuit. In my design I used the first version, without the 1M ohm resistor. The second version, is the version that I believe is correct. The cristal is a 15MHz (15.000H5M) Firware: Initially, I did a configuration, in a separated file, starting without the external oscillator: // Select Internal FRC at POR _FOSCSEL(FNOSC_FRC & IESO_OFF & PWMLOCK_OFF ); // Enable Clock Switching and Configure POSC in HS mode _FOSC(FCKSM_CSECMD & OSCIOFNC_OFF & POSCMD_HS & IOL1WAY_OFF); //Desliga o watchdog _FWDT( FWDTEN_OFF ) //Ativa os pinos de debug EMUC2 e EMUD2 e deabilita os de JTAG. _FICD( ICS_PGD2 & JTAGEN_OFF ) //Desabilita qualquer proteção de codigo para depuracao _FGS( GWRP_OFF & GCP_OFF ) After that initialization, I configured my device and change the oscilator frequency and chosse external oscillator: void oscilador_configuraOscilador(){ CLKDIVbits.PLLPRE = 1; // N1 - 2 CLKDIVbits.PLLPOST = 0; // (N2/2) - 1 PLLFBDbits.PLLDIV = 46; // M - 2 RCONbits.SWDTEN = 0; // Torna o clock do sistema Fcy igual ao clock do periférico Fp. CLKDIVbits.DOZE = 0x000; CLKDIVbits.DOZEN = 0; // Initiate Clock Switch to Primary Oscillator with PLL (NOSC=0b011) __builtin_write_OSCCONH(0x03); __builtin_write_OSCCONL(OSCCON | 0x01); // Wait for Clock switch to occur while (OSCCONbits.COSC!= 0b011); // Wait for PLL to lock while (OSCCONbits.LOCK!= 1); } Doubts: 1 ) My first question is, wich one is the correct version of the circuit? 2 ) Is my code correct ? Even if the second version is the correct version ? (Remembering that my code here was made based on the first version of the circuit, without the resistor) Any help would be very appreciated. With my best regards. Daniel. Attached Image(s) |
|
相关推荐
2个回答
|
|
虽然内置了一个反馈电阻,外部反馈电阻器被推荐用于XT RESP。源代码:考虑振荡器模块的FRM的2种变型:HTTP://WW1.MICCHIP.CON/DEVIDES/En/DeVICECD/70580C.PDF-图7- 3在第718HTTP//WW1.MICCHIP.COM/DIXBOSS/En/DeVICECD/O7000 01313A.PDF-第21页的图5-1上。在OSC2和石英之间(470 R)(反馈电阻器是否被连接或超过这个电阻器)并不重要,以减少最终的时钟发射。产生的振荡器可能比正常情况慢一点,但这种时钟的发射可以大大减少。最好的电阻值的计算有点困难,所以“实验”可能是一个可行的方法,如果你不需要最后的排放抑制。
以上来自于百度翻译 以下为原文 Although a feedback resistor is built-in, an external feedback resistor is recommended for XT resp. HS oscillator modes. Sources: 2 variants of the FRM considering the oscillator module: http://ww1.microchip.com/downloads/en/devicedoc/70580c.pdf - fig. 7-3 on page 7-18 http://ww1.microchip.com/downloads/en/DeviceDoc/70005131a.pdf - fig. 5-1 on page 21. What I'd recommend: add a series resistor (start with 470 R) between OSC2 and the quartz (doesn't really matter whether the feedback resistor is connected pre or past this resistor= to reduce eventual clock emissions. The resulting oscillator might start a bit slower than normal, but emissions of the clock can be reduced significantly this way. The calculation of the best resistor value is somewhat difficult so "experimenting" might be a viable way if you do not need the very last of emissions suppression. |
|
|
|
我有两个程序可以帮助:1。第一个是设置内部和外部XTAL寄存器的程序。2。第二个程序选择最好的/最近的频率。你告诉它你想要什么,你有什么,它产生神奇的N1,N2,M和OSCTUN参数。我很久没有使用外部XTAL了,我记不起来使用电阻器。我想我可能已经使用了30PF盖,它们可能有20%个。
以上来自于百度翻译 以下为原文 I have two programs that may be of help: 1. The first is a program that sets internal and external xtal registers. 2. The second program picks the best/nearest frequency. You tell it what you want and what you have and it produces the magic N1, N2, M and OSCTUN parameters. I haven't used an external xtal for ages, I cannot remember using a resistor. I think I may have used 30pf caps and they were likely 20% out. |
|
|
|
只有小组成员才能发言,加入小组>>
5181 浏览 9 评论
2004 浏览 8 评论
1931 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3177 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2228 浏览 5 评论
738浏览 1评论
622浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
509浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
636浏览 0评论
533浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 09:46 , Processed in 1.140885 second(s), Total 78, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号