完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,我一直在玩PIC16F18313。但是,我不清楚PIC16F18313是否有一个8MHz的内部振荡器。在数据表中搜索,你可以指定你要使用哪一个振荡器,首先在配置位:这里我把配置位I。对于这个问题,我认为我正确地配置了使用1MHz的内部振荡器。稍后在程序中,我用1行代码来调整振荡器时钟:我的问题是:这是正确的方法吗?我评论OsTuneButsHftun,因为我认为没有必要去调整它。我是正确的方式?我不能测试它,因为我手中没有硬件。谢谢,我希望能得到你们的帮助。
以上来自于百度翻译 以下为原文 Hello People, I've been playing with a PIC16F18313. However, I don't have a clear idea if PIC16F18313 has an Internal Oscillator at 8MHz. Searching in the Datasheet it says that you can specify which oscillator are you going to use, firstly in the configuration bits: // PIC16F18313 Configuration Bit Settings // 'C' source line config statements // CONFIG1 #pragma config FEXTOSC = OFF // FEXTOSC External Oscillator mode Selection bits (Oscillator not enabled) #pragma config RSTOSC = HFINT1 // Power-up default value for COSC bits (HFINTOSC (1MHz)) #pragma config CLKOUTEN = OFF // Clock Out Enable bit (CLKOUT function is disabled; I/O or oscillator function on OSC2) Here I put the configurations bit important for this issue, I think I configured correctly to use the Internal Oscillator at 1MHz. Later in the very beggining of the program I put 1 line of code to adjust the oscillator clock: OSCFRQbits.HFFRQ = 0b0100; // 8MHz Clock Source selected //OSCTUNEbits.HFTUN = 0b0100; // 8MHz clock source adjusted My question is: Is this the correct way to do this? I comment the OSCTUNEbits.HFTUN because I consider that Is not necessary to adjust it. I'm in the correct way? I can't test it because I don't have the hardware in my hands. Thanks and I hope to get a good help from you guys. |
|
相关推荐
6个回答
|
|
来自HTTP://www. McCHIP.COM/FUMMS/M102171.ASPX
以上来自于百度翻译 以下为原文 comes from http://www.microchip.com/forums/m1021711.aspx |
|
|
|
|
|
|
|
是的!我认为它们是不同的问题,而不是“相关的”,最好单独写两个线程。如果不是一个好主意,抱歉。
以上来自于百度翻译 以下为原文 Yes it is! I thought that they are different issues and are not "related" It was better to write two threads individually. Sorry if was not a great idea. |
|
|
|
是的!但也许是那个PIC的专家能更容易地回答这两个问题。
以上来自于百度翻译 以下为原文 Yes they are! But maybe someone that is an expert of that PIC will be able to answer both question, more easily. |
|
|
|
您还需要将NDIV设置为0;当使用HFIFT1时,NDIV默认为2。
以上来自于百度翻译 以下为原文 You also need to set NDIV to 0; it defaults to 2 when HFINT1 is used. |
|
|
|
哦!很好,我检查了数据表,在OSCON1寄存器中,它告诉我你的建议是什么。嗯,如果没有什么可以补充的。我希望我的振荡器设置正确配置。如果还有别的事情我应该做的话,我会睁大耳朵。真的谢谢大家。
以上来自于百度翻译 以下为原文 Oh! Excellent, I checked on the datasheet and in OSCCON1 register it says what you suggest me as a NOTE. Well, if there is nothing else to add. I hope that I have my oscillator setup correctly configured. If there is something else that I should do, I have my ears open. Really thank you all. |
|
|
|
只有小组成员才能发言,加入小组>>
5244 浏览 9 评论
2035 浏览 8 评论
1955 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3209 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2260 浏览 5 评论
779浏览 1评论
672浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
598浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
682浏览 0评论
579浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-25 09:34 , Processed in 1.352089 second(s), Total 56, Slave 50 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号