完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我有DSPIC33 EP128GS808 DEV板。我正试着把时钟从FRC切换到主振荡器,但是它被困在while循环中。我忘记安装什么了吗?这里是振荡器设置:这是保险丝设置:
以上来自于百度翻译 以下为原文 Hi, I have the dsPIC33EP128GS808 dev board. I'm trying to switch the clock from FRC to Primary oscillator, but its getting stuck at the while loop. Is there something I forgot to setup up? Here's the oscillator setup: /* Configure PLL prescaler, PLL postscaler, PLL divisor */ /* External Crystal Configuration */ PLLFBD = 54; /* M = PLLFBD + 2 */ CLKDIVbits.PLLPRE = 6; /* N1 = PLLPRE + 2 */ CLKDIVbits.PLLPOST = 0; /* N2 = 2 * (PLLPOST + 1) */ /* Change oscillator to Primary Oscillator + PLL */ __builtin_write_OSCCONH(0x03); /* New Oscillator Primary w/ PLL */ __builtin_write_OSCCONL(0x01); /* Enable Clock Switch */ while (OSCCONbits.COSC != 0x03); /* Wait for new Oscillator to become Primary w/ PLL */ while (OSCCONbits.LOCK != 1); /* Wait for Pll to Lock */ ACLKCONbits.ASRCSEL = 0; ACLKCONbits.FRCSEL = 1; /* FRC is input to Auxiliary PLL */ ACLKCONbits.SELACLK = 1; /* Auxiliary Ocillator provides clock source for PWM */ ACLKCONbits.APSTSCLR = 0b111; /* Divide Auxiliary clock by 1 */ ACLKCONbits.ENAPLL = 1; /* Enable Auxiliary PLL */ while (ACLKCONbits.APLLCK != 1) /* Wait for Aux. PLL to Lock Here's the fuse setup: // FOSCSEL #pragma config FNOSC = FRC // Oscillator Source Selection (Internal Fast RC (FRC)) #pragma config IESO = ON // Two-speed Oscillator Start-up Enable bit (Start up device with FRC, then switch to user-selected oscillator source) // FOSC #pragma config POSCMD = HS // Primary Oscillator Mode Select bits (HS Crystal Oscillator Mode) #pragma config OSCIOFNC = OFF // OSC2 Pin Function bit (OSC2 is clock output) #pragma config IOL1WAY = OFF // Peripheral pin select configuration bit (Allow multiple reconfigurations) #pragma config FCKSM = CSDCMD // Clock Switching Mode bits (Both Clock switching and Fail-safe Clock Monitor are disabled) #pragma config PLLKEN = ON_PLL // PLL Lock Enable Bit (Clock switch to PLL source will wait until the PLL lock signal is valid) |
|
相关推荐
1个回答
|
|
同样,它似乎Stutps://www. McCys.com /论坛/ M1045 186. ASPXα1058354(可能是由于长时间批准…)
以上来自于百度翻译 以下为原文 same, it seems https://www.microchip.com/forums/m1045186.aspx#1058354 (maybe due to long-time-approval...) |
|
|
|
只有小组成员才能发言,加入小组>>
5234 浏览 9 评论
2026 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3201 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
771浏览 1评论
659浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
588浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
670浏览 0评论
571浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-20 13:56 , Processed in 1.292062 second(s), Total 78, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号