完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
大家好,在PIC32MZ0512EFE064中用8MHz晶体配置振荡器有问题。开始时,我注意到PIC打开BFRC(Back-Up Fast RC)振荡器,设置CF标志(时钟故障检测位)。因此我禁用了BFRC,现在PIC没有启动,如我所料。我用示波器检查了信号,什么也没出现,OSC2管脚上只有500mV的余弦,OSC1管脚上只有0V。即使用PIC32MZ2048EFH100在另一块板上,问题仍然存在,所以我认为问题不是硬件。我试图改变连接到晶体(22PF和27 PF)的电容值,但没有。有人能帮助我吗?为什么水晶不起作用?遵循我的代码和图片的连接布局和水晶的示意图。
以上来自于百度翻译 以下为原文 Hello everyone, I have a problem configuring the oscillator in a PIC32MZ0512EFE064 with a 8MHz crystal. Initially, at startup I noticed that the PIC switches on the BFRC (Back-Up Fast RC) oscillator setting the CF flag (Clock Fail Detect bit). So I disabled the BFRC and now the PIC doesn’t start, as I expected. I checked the signal with oscilloscope and nothing appears, only 500mV costant on the OSC2 pin and 0V on the OSC1 pin. The problem persist even on another board with a PIC32MZ2048EFH100, so I think that the problem is not hardware. I tried to change the value of capacitors connected to the crystal (22pF and 27pF) but nothing. Can anyone help me? Why the crystal doesn’t works? Following my code and the pictures of the connection layout and schematic of the crystal. #include #include #include #include //// DEVCFG3 //// USERID = No Setting #pragma config FMIIEN = OFF // Ethernet RMII/MII Enable (RMII Enabled) #pragma config FETHIO = OFF // Ethernet I/O Pin Select (Alternate Ethernet I/O) #pragma config PGL1WAY = OFF // Permission Group Lock One Way Configuration (Allow multiple reconfigurations) #pragma config PMDL1WAY = OFF // Peripheral Module Disable Configuration (Allow multiple reconfigurations) #pragma config IOL1WAY = OFF // Peripheral Pin Select Configuration (Allow multiple reconfigurations) #pragma config FUSBIDIO = OFF // USB USBID Selection (Controlled by Port Function) // //// DEVCFG2 #pragma config FPLLIDIV = DIV_1 // System PLL Input Divider (1x Divider) #pragma config FPLLRNG = RANGE_5_10_MHZ // System PLL Input Range (5-10 MHz Input) #pragma config FPLLICLK = PLL_POSC // System PLL Input Clock Selection (POSC is input to the System PLL) #pragma config FPLLMULT = MUL_20 // System PLL Multiplier (PLL Multiply by 20) #pragma config FPLLODIV = DIV_2 // System PLL Output Clock Divider (2x Divider) #pragma config UPLLFSEL = FREQ_24MHZ // USB PLL Input Frequency Selection (USB PLL input is 24 MHz) // //// DEVCFG1 #pragma config FNOSC = POSC // Oscillator Selection Bits (System POSC) #pragma config DMTINTV = WIN_127_128 // DMT Count Window Interval (Window/Interval value is 127/128 counter value) #pragma config FSOSCEN = OFF // Secondary Oscillator Enable (Disable SOSC) #pragma config IESO = OFF // Internal/External Switch Over (Disabled) #pragma config POSCMOD = HS // Primary Oscillator Configuration (HS osc mode) #pragma config OSCIOFNC = OFF // CLKO Output Signal Active on the OSCO Pin (Disabled) #pragma config FCKSM = CSECMD // Clock Switching and Monitor Selection (Clock Switch Enabled, FSCM Disabled) #pragma config WDTPS = PS1048576 // Watchdog Timer Postscaler (1:1048576) #pragma config WDTSPGM = STOP // Watchdog Timer Stop During Flash Programming (WDT stops during Flash programming) #pragma config WINDIS = NORMAL // Watchdog Timer Window Mode (Watchdog Timer is in non-Window mode) #pragma config FWDTEN = OFF // Watchdog Timer Enable (WDT Disabled) #pragma config FWDTWINSZ = WINSZ_25 // Watchdog Timer Window Size (Window size is 25%) #pragma config DMTCNT = DMT31 // Deadman Timer Count Selection (2^31 (2147483648)) #pragma config FDMTEN = OFF // Deadman Timer Enable (Deadman Timer is disabled) // //// DEVCFG0 #pragma config DEBUG = OFF // Background Debugger Enable (Debugger is disabled) #pragma config JTAGEN = OFF // JTAG Enable (JTAG Disabled) #pragma config ICESEL = ICS_PGx2 // ICE/ICD Comm Channel Select (Communicate on PGEC2/PGED2) #pragma config TRCEN = OFF // Trace Enable (Trace features in the CPU are disabled) #pragma config BOOTISA = MIPS32 // Boot ISA Selection (Boot code and Exception code is MIPS32) #pragma config FECCCON = OFF_UNLOCKED // Dynamic Flash ECC Configuration (ECC and Dynamic ECC are disabled (ECCCON bits are writable)) #pragma config FSLEEP = OFF // Flash Sleep Mode (Flash is powered down when the device is in Sleep mode) #pragma config DBGPER = ALLOW_PG2 // Debug Mode CPU Access Permission (Allow CPU access to Permission Group 2 permission regions) #pragma config SMCLR = MCLR_NORM // Soft Master Clear Enable bit (MCLR pin generates a normal system Reset) #pragma config SOSCGAIN = GAIN_2X // Secondary Oscillator Gain Control bits (2x gain setting) #pragma config SOSCBOOST = OFF // Secondary Oscillator Boost Kick Start Enable bit (Boost the kick start of the oscillator) #pragma config POSCGAIN = GAIN_1X // Primary Oscillator Gain Control bits (2x gain setting) #pragma config POSCBOOST = ON // Primary Oscillator Boost Kick Start Enable bit (Boost the kick start of the oscillator) #pragma config EJTAGBEN = NORMAL // EJTAG Boot (Normal EJTAG functionality) // //// DEVCP0 #pragma config CP = OFF // Code Protect (Protection Disabled) int i; #define LED_SEND_DATA LATEbits.LATE7 void Init_System(void); void Delay_ms(unsigned int); void Init_System(void) { // Set port's sygnals as digital ANSELB = 0x00000000; ANSELE = 0x00000000; ANSELG = 0x00000000; // Set Input=1/Output=0 TRISB = 0xFFFFFFFF; TRISC = 0xFFFFFFFF; TRISD = 0xFFFFFFFF; TRISE = 0xFFFFFFFF; TRISF = 0xFFFFFFFF; TRISG = 0xFFFFFFFF; // Set STDOUT on UART1 __XC_UART = 1; // Disable all Interrupts __builtin_disable_interrupts(); // Set Peripheral Bus 2 Clock to SYSCLK/DIV_4 SYSKEY = 0x00000000; // Start unlock sequence SYSKEY = 0xAA996655; SYSKEY = 0x556699AA; while (PB2DIVbits.PBDIVRDY == 0) ; PB2DIVbits.PBDIV = GetSystemClock() / GetPeripheral2Clock() - 1; PB2DIVbits.ON = 1; SYSKEY = 0x33333333; // Configure Interrupt Controller for Multi-Vector Mode PRISS = 0x76543210; INTCONSET = _INTCON_MVEC_MASK; // Set the MVEC bit // Enable all Interrupts __builtin_enable_interrupts(); } void Delay_ms(unsigned int delay) { _CP0_SET_COUNT(0); register unsigned int waitCnt = delay * ((GetSystemClock() / 2) / 1000); while(_CP0_GET_COUNT() < waitCnt); } main() { Init_System(); TRISEbits.TRISE7 = 0; // LED_SEND_DATA while(true) { LED_SEND_DATA = ~LED_SEND_DATA; Delay_ms(1000); } } Attached Image(s) |
|
相关推荐
8个回答
|
|
“PIC32 MZ嵌入式连接与浮点单元(EF)-家庭硅勘误表和数据表澄清”的项目2:晶体振荡器不能用作主振荡器(OSC1/OSC2引脚)的输入。您必须使用外部振荡器。
以上来自于百度翻译 以下为原文 Item 2 of the "PIC32MZ Embedded Connectivity with Floating Point Unit (EF) - Family Silicon Errata and Data Sheet Clarification": A crystal oscillator cannot be used as an input to the Primary Oscillator (OSC1/OSC2 pins). You have to use an external oscillator. |
|
|
|
天啊!这是一个设计错误还是一个明显的特征?不管怎样,还是谢谢你。
以上来自于百度翻译 以下为原文 OMG! Is it a design error or a deliberate feature? Thanks anyway. |
|
|
|
他们现在有A3硅释放,据说与晶体一起工作。如果你读了勘误表,它们有精确的示意图和电阻值,以及应该工作的熔断器的精确选择。
以上来自于百度翻译 以下为原文 They have now A3 silicon release which is said to work with crystals. If you read the errata, they have the exact schematic and resistor values as well as the exact selection of fuses that are supposed to work. |
|
|
|
但一定要检查晶体规格的切割和电容。
以上来自于百度翻译 以下为原文 But be sure to check the crystal spec for cut and capacitance. |
|
|
|
如果你卡在板上接触微芯片。据说有一个水晶牌子,它也可以工作。它也应该在老柱子里。先读勘误表。
以上来自于百度翻译 以下为原文 If you are stuck with a board contact Micro chip. Reportedly there is a brand of crystal that does work. It should also be in the old Posts. Always read the Errata First. |
|
|
|
好的,但是我怎么才能在Apple站点上找到A3硅版本(比如Mouser,FaNell等)?我能在微控制器芯片的硅芯片上继续观察吗?
以上来自于百度翻译 以下为原文 Ok, but how can I find the A3 silicon release on the distributors sites (like Mouser, Farnell, etc...)? And where I can stay tuned on the microchip site with the silicon release of microcontrollers? |
|
|
|
数据表中有勘误表,您需要与分发服务器或MICCHIPCORD联系以请求A3部件。
以上来自于百度翻译 以下为原文 The Errata is with the Data sheet. You would need to contact The distributor or MicrochipDirect to request the A3 Parts |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
5166 浏览 9 评论
2000 浏览 8 评论
1929 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3175 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2227 浏览 5 评论
736浏览 1评论
619浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
507浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
633浏览 0评论
530浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-25 11:30 , Processed in 1.440781 second(s), Total 93, Slave 76 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号