Microchip
直播中

毛玲燕

7年用户 219经验值
私信 关注
[问答]

DSPIC33 EP64 MC202怎么做威廉希尔官方网站 和如何配置

大家好,在我的项目中,我使用的是一个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)

王璨

2018-9-12 14:49:42
虽然内置了一个反馈电阻,外部反馈电阻器被推荐用于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.
举报

李涛

2018-9-12 15:01:32
我有两个程序可以帮助: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.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分