完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我正在努力为PIC16F19156的Fosc选择内部振荡器。配置位FEXOSCC=0B000 OSCFRQYHFFRQQ= 0B010(4兆赫标称)-配置比特RSTOSC=HFIFT32(0B000)i得到Fosc=32兆赫-用RSTOSC=HFIMT1(0B110),我得到1 MHZSO,它看起来对我设置OSCFR。QYHFFRQ=0B010没有期望的效果。我错过了什么?问候,Rob。
以上来自于百度翻译 以下为原文 I'm struggling with selecting 4MHz for Fosc of PIC16F19156 with internal oscillator. Config bits FEXTOSC = 0b000 OSCFRQ_HFFRQ = 0b010 (4 MHz nominal) - with config bits RSTOSC = HFINT32 (0b000) I get Fosc = 32 MHz - with RSTOSC = HFINT1 (0b110) I get 1 MHz So it looks to me that setting OSCFRQ_HFFRQ = 0b010 does not have the desired effect. What am I missing? Regards, Rob. |
|
相关推荐
16个回答
|
|
章节“92.2.1 HFIFToSC”说它会给你1MHZIT出现,CDIV寄存器对两种模式的设置不同。
以上来自于百度翻译 以下为原文 Section "9.2.2.1 HFINTOSC" does say it will give you 1MHz It appears the CDIV register is setup differently for the two modes. |
|
|
|
第92.2.1节还说:通过设置OFFRQ<2:0&GT位的OSCFRQ寄存器,可以选择HFIFOTSC频率。据我所知,HFRTOSC的默认频率是用RSTOSC配置位选择为1 MHz或32 MHz,但这可以用OSCFRQH H进行修改。FFRQ位,见第9.6节寄存器9至6。但在下面的图中,我也读到:注1:当RSTOSC=110(HFIFTROC 1 MHz)时,HFFRQ比特将在复位时默认为“010”;当RSTOSC=000(HFIFTROC 32 MHz)时,HFFRQ比特将在复位后默认为“110”。从中我了解到,RSTOSC=0B110 Fosc默认为4 MHz;迷惑!顺便说一下,16F19156的振荡器部分看起来非常(也许是)类似于16F18856,我没有问题,在4兆赫的情况下得到完全相同的程序的FoSC!
以上来自于百度翻译 以下为原文 Section 9.2.2.1 also says: The HFINTOSC frequency can be selected by setting the HFFRQ<2:0> bits of the OSCFRQ register. So as far as I understand it: the default frequency of HFINTOSC is selected with the RSTOSC configuration bits as 1 MHz or 32 MHz, but this can be modified with the OSCFRQ_HFFRQ bits, see section 9.6 REGISTER 9-6. But below this figure I read also: Note 1: When RSTOSC=110 (HFINTOSC 1 MHz), the HFFRQ bits will default to ‘010’ upon Reset; when RSTOSC = 000 (HFINTOSC 32 MHz), the HFFRQ bits will default to ‘110’ upon Reset. From which I understand that with RSTOSC=0b110 Fosc would by default be 4 MHz! Confusing! BTW The oscillator part of the 16f19156 looks very (maybe is) similar to that of e.g. the 16f18856, with which I have no problem to get the Fosc at 4 MHz with exactly te same program! |
|
|
|
|
|
|
|
尝试这些:RSTOSC&LT;2:0&Gt;=110(Hfimtoc 1 MHz)OSCCON1&LT;NOSCC & Gt;=110(HFIFOSTC设置用SoFrqq & lt;HFFRQ&GT;比特)OSCFRQ & lt;HFFRQ & gt;=010(4 MHz)
以上来自于百度翻译 以下为原文 Try these:
|
|
|
|
到目前为止,我并不关心,但它似乎是CDIV=0001。请解释为什么这将解释原来的观察(Fosc是1或32兆赫,而不是介于两者之间)。
以上来自于百度翻译 以下为原文 So far I didn't care, but it seems CDIV = 0001. Please explain why this would explain the original observations (Fosc is either 1 or 32 MHz, not somewhere between). |
|
|
|
LAT0:遵循你的建议:仍然运行在1兆赫
以上来自于百度翻译 以下为原文 @land0: followed your suggestion: still running at 1 MHz |
|
|
|
尝试添加到以前的设置:OSCCON1和LT;NDIV&GT;=0000(1:1)&编辑;GT;即RSTOSC和LT;2:0&Gt=110(HFIFTROC 1 MHz)OSCCON1&LT;NOSC和GT;=110(HFIFOSTC设置用SOCFRQ和LT;HFFRQ & GT;比特)OSCCON1&LT;NDIV&Gt;=0000(1:1)OSCFRQ & lt;HFFRQ & gt;=010(4 MHz)。
以上来自于百度翻译 以下为原文 Try adding to previous settings:
|
|
|
|
因为“疑似”CDIV= 0B001,我已经有NDIV= 0B000了。
以上来自于百度翻译 以下为原文 Because of the 'suspected' CDIV=0b0001 I already had the NDIV=0b0000 in place. |
|
|
|
[/开始免责声明]我没有PIC16F19156来测试这个,但是我认为它是值得一试的,基于数据表中的相似性。[/[结束免责声明] [/开始编辑]见后一篇文章,在那里我验证了PIC16F19156的[修复]。不久前,当我正在评估PIC16F15355,IN时,在OSCFRQ寄存器中,关于HFFRQ描述的混淆内容,即(这一部分的数据表与您的芯片的数据表相同,我想)是的,当您设置配置RSTOSC等于HFTNT1时,HFFRQ位的启动值为0B010,对应于4 MHz A。顺着桌子走。显然,他们没有告诉我们一些关于他们的事情,对吧?实际上,这给出了1兆赫,所以我试着把HFFRQ转换成0B101,对应于一个时钟频率四倍的启动值。这是我的小测试程序,它使LED闪烁有一个特定的节奏,让我知道它是有效的。(我也观察到一个1兆赫的信号在CKOUT上,表明CPU运行在4兆赫,但这只是锦上添花。)底线:巴达兵,巴达繁荣!IWFMYMMV(它为我工作,你的里程可能会有所不同)。在我的PIC16F15355评估项目与XC8版本1.44,MPLABX版本4.01问候,戴夫
以上来自于百度翻译 以下为原文 [/Begin Disclaimer] I don't have a PIC16F19156 to test this, but I think it's worth a shot, based on similarities in the data sheets. [/End Disclaimer] [/Begin Edit] See later post, where I verified the same "fix" for a PIC16F19156. [/End Edit] A little while ago, when I was evaluating a PIC16F15355, I noticed the confusing thing about the HFFRQ description in the OSCFRQ register, namely (This section of the data sheet is identical to the data sheet of your chip, I think.) Yes, when you set the configuration RSTOSC equal HFINT1, the startup value for the HFFRQ bits is 0b010, corresponding to 4 MHz according to the table. There is, apparently, some friggin' in the riggin' that they didn't tell us about, right? Well, this actually gives 1 MHz, so I tried changing HFFRQ to 0b101, corresponding to a clock frequency four times the listed startup value. Here's my little test program, which makes an LED blink with a particular cadence, to show me that it works. (I also observe a 1 MHz signal on CLKOUT, indicating that the CPU is running at 4 MHz, but that's just icing on the cake.) // Get the furshlugginer clock to run at 4 MHz // // davekw7x // PIC16F15355 Configuration Bit Settings // 'C' source line config statements // CONFIG1 #pragma config FEXTOSC = OFF // External Oscillator mode selection bits (Oscillator not enabled) #pragma config RSTOSC = HFINT1 // Power-up default value for COSC bits (HFINTOSC (1MHz)) #pragma config CLKOUTEN = ON // Clock Out Enable bit (CLKOUT function is enabled; FOSC/4 clock appears at OSC2) #pragma config CSWEN = ON // Clock Switch Enable bit (Writing to NOSC and NDIV is allowed) #pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable bit (FSCM timer enabled) // CONFIG2 #pragma config MCLRE = ON // Master Clear Enable bit (MCLR pin is Master Clear function) #pragma config PWRTE = ON // Power-up Timer Enable bit (PWRT enabled) #pragma config LPBOREN = OFF // Low-Power BOR enable bit (ULPBOR disabled) #pragma config BOREN = OFF // Brown-out reset enable bits (Brown-out reset disabled) #pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (VBOR) set to 1.9V on LF, and 2.45V on F Devices) #pragma config ZCD = OFF // Zero-cross detect disable (Zero-cross detect circuit is disabled at POR.) #pragma config PPS1WAY = OFF // Peripheral Pin Select one-way control (The PPSLOCK bit can be set and cleared repeatedly by software) #pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable bit (Stack Overflow or Underflow will cause a reset) // CONFIG3 #pragma config WDTCPS = WDTCPS_31// WDT Period Select bits (Divider ratio 1:65536; software control of WDTPS) #pragma config WDTE = OFF // WDT operating mode (WDT Disabled, SWDTEN is ignored) #pragma config WDTCWS = WDTCWS_7// WDT Window Select bits (window always open (100%); software control; keyed access not required) #pragma config WDTCCS = SC // WDT input clock selector (Software Control) // CONFIG4 #pragma config BBSIZE = BB512 // Boot Block Size Selection bits (512 words boot block size) #pragma config BBEN = OFF // Boot Block Enable bit (Boot Block disabled) #pragma config SAFEN = OFF // SAF Enable bit (SAF disabled) #pragma config WRTAPP = OFF // Application Block Write Protection bit (Application Block not write protected) #pragma config WRTB = OFF // Boot Block Write Protection bit (Boot Block not write protected) #pragma config WRTC = OFF // Configuration Register Write Protection bit (Configuration Register not write protected) #pragma config WRTSAF = OFF // Storage Area Flash Write Protection bit (SAF not write protected) #pragma config LVP = ON // Low Voltage Programming Enable bit (Low Voltage programming enabled. MCLR/Vpp pin function is MCLR.) // CONFIG5 #pragma config CP = OFF // UserNVM Program memory code protection bit (UserNVM code protection disabled) // #pragma config statements should precede project file includes. // Use project enums instead of #define for ON and OFF. #include #define _XTAL_FREQ 4000000UL // LED1 is Pin 27 // #define LED1 LATBbits.LATB6 #define LED1_TRIS TRISBbits.TRISB6 void main() { LED1_TRIS = 0; // Note that pragma sets RSTOSC = HFINT1 // Read the fine print of the OSCFRQ description, and extrapolate (guess) // what it takes to make the clock run at 4 MHz OSCFRQbits.HFFRQ = 0b101; while (1) { LED1 ^= 1; __delay_ms(1000); } } Bottom line: Bada bing, bada boom! IWFMYMMV (It Works For Me; Your Mileage May Vary). Tested in my PIC16F15355 evaluation project with XC8 version 1.44, MPLABX version 4.01 Regards, Dave |
|
|
|
是的,如果选择HFTNT1,它将CDIV设置为2,所有的HMIFT1一起生成1 MHz(数据表的第152页)。
以上来自于百度翻译 以下为原文 Yes, it sets CDIV to 2 if you select HFINT1 which all together produces 1 MHz (page 152 of the datasheet). |
|
|
|
@ DavekW7X:我恐怕它与HFFRQ= 0B101的伎俩在这里不能用16F15356。在几个数据表注释4与OSCCON1使我有点清楚:当ONC=110(HfimToC 4 MHz),NDIV位将默认为“0010”时重置;对于所有其他NOSC设置NDIB BI在重置时TS将默认为“0000”。如果我正确理解,则有2种情况:1。使用RSTOSC=0B000,最终Fosc用OSCFRQH-HFFRQ(0B010为4 MHz)选择2。用RSTOSC=0B110 Fosc用NDIV选择。内部振荡器在4 MHz下运行,NDIV默认为0B00,导致FoSC 1 MHz。NDIV= 0B000,你应该得到4兆赫!我提到我对16F18856没有任何问题。适用于情况1!有了RSTOSC=0B110(情况2),只有当我设置NDIV=0B00时,才得到4 MHz。然而,奇怪的是,这似乎不适用于16F15356或16F19156(我确实关心将配置位CSWEN设置为1)。顺便说一下,谢谢你的样板代码。我可以读写C,但我在JAL(JALV2)中做PIC编程。为了确保我的结论,我今天重复了测试。结果证实了我之前的观察结果。见附件屏幕截图。
以上来自于百度翻译 以下为原文 @davekw7x: I'm afraid it looks like your trick with HFFRQ=0b101 does not work here with a 16f15356. In several datasheets Note 4 with OSCCON1 makes it somewhat clearer to me: When NOSC = 110 (HFINTOSC 4 MHz), the NDIV bits will default to ‘0010’ upon Reset; for all other NOSC settings the NDIV bits will default to ‘0000’ upon Reset. If I understand it correctly there are 2 situations: 1. With RSTOSC=0b000 the ultimate Fosc is selected with OSCFRQ_HFFRQ (0b010 for 4 MHz) 2. With RSTOSC=0b110 Fosc is selected with NDIV. The internal oscillator runs then at 4 MHz and NDIV defaults to 0b0010 resulting in Fosc 1 MHz. With NDIV=0b0000 you should get 4 MHz! I mentioned that I had no problems with the 16f18856. That applied to situation 1! With RSTOSC=0b110 (situation 2) I get 4 MHz only when I set NDIV=0b0000. However strangely enough this seems not to work for the 16f15356 or 16f19156 (I did care to set config bit CSWEN to 1!) BTW Thanks for your sample code. I can read and write C, but I do my PIC programming in JAL (JalV2). To be sure about my conclusions I repeated the tests today. The results confirm my earlier observations. See attached screenshot. Attached Image(s) |
|
|
|
嗯,我想这不会有助于原来的海报(我不知道他的问题是什么),但我想我会跟进,以防其他人跑过这条线。自从我以前的帖子,我已经获得了PIC16F19156,我发现,为另一个芯片发现的修复也适用于这一点。它的工作(对我来说)恰好是我试图解释的。底线:下面的测试程序在我的电路板上用PIC16F19156运行,我的LED闪烁了一秒钟(一秒钟)的节奏,我看到CKOUT引脚上的1 MHz,所以我知道芯片运行在4兆赫。我没有PIC16F16356,也没有理由买一个,所以这就是我现在要做的所有贡献。
以上来自于百度翻译 以下为原文 Well, I guess this won't help the Original Poster (I don't know what his problem is/was), but I thought I would follow up in case others run across this thread. Since my previous post, I have obtained a PIC16F19156, and I find that the fix I discovered for the other chip works for this one also. It works (for me) exactly as I tried to explain it. Bottom line: With the following test program running on my breadboard with a PIC16F19156, my LED blinks with a cadence of (one second on) / (one second off), and I see 1 MHz on the CLKOUT pin, so I know the chip is running at 4 MHz. I don't have a PIC16F16356, and have no reason to get one, so this is just about all I have to contribute at this time. // Get the furshlugginer clock to run at 4 MHz // // davekw7x // XC8 version 1.44, MPLABX version 4.01, PICkit 3 // October, 2017 // PIC16F19156 Configuration Bit Settings // 'C' source line config statements // CONFIG1 #pragma config FEXTOSC = OFF // External Oscillator mode selection bits (Oscillator not enabled) #pragma config RSTOSC = HFINT1 // Power-up default value for COSC bits (HFINTOSC (1MHz)) #pragma config CLKOUTEN = ON // Clock Out Enable bit (CLKOUT function is enabled; FOSC/4 clock appears at OSC2) #pragma config VBATEN = OFF // VBAT Pin Enable bit (VBAT functionality is disabled) #pragma config LCDPEN = OFF // LCD Charge Pump Mode bit (LCD Charge Pump is disabled.) #pragma config CSWEN = ON // Clock Switch Enable bit (Writing to NOSC and NDIV is allowed) #pragma config FCMEN = ON // Fail-Safe Clock Monitor Enable bit (FSCM timer enabled) // CONFIG2 #pragma config MCLRE = ON // Master Clear Enable bit (MCLR pin is Master Clear function) #pragma config PWRTE = PWRT_64 // Power-up Timer selection bits (PWRT set at 64 ms) #pragma config LPBOREN = OFF // Low-Power BOR enable bit (ULPBOR disabled) #pragma config BOREN = OFF // Brown-out reset enable bits (Brown-out reset disabled) #pragma config BORV = LO // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (VBOR) set to 1.9V on LF, and 2.45V on F Devices) #pragma config ZCD = OFF // Zero-cross detect disable (Zero-cross detect circuit is disabled at POR.) #pragma config PPS1WAY = OFF // Peripheral Pin Select one-way control (The PPSLOCK bit can be set and cleared repeatedly by software) #pragma config STVREN = ON // Stack Overflow/Underflow Reset Enable bit (Stack Overflow or Underflow will cause a reset) // CONFIG3 #pragma config WDTCPS = WDTCPS_31// WDT Period Select bits (Divider ratio 1:65536; software control of WDTPS) #pragma config WDTE = OFF // WDT operating mode (WDT Disabled, SWDTEN is ignored) #pragma config WDTCWS = WDTCWS_7// WDT Window Select bits (window always open (100%); software control; keyed access not required) #pragma config WDTCCS = SC // WDT input clock selector (Software Control) // CONFIG4 #pragma config BBSIZE = 512 // Boot Block Size Selection bits (Boot Block Size (Words) 512) #pragma config BBEN = OFF // Boot Block Enable bit (Boot Block disabled) #pragma config SAFEN = OFF // SAF Enable bit (SAF disabled) #pragma config WRTAPP = OFF // Application Block Write Protection bit (Application Block NOT write-protected) #pragma config WRTB = OFF // Boot Block Write Protection bit (Boot Block NOT write-protected) #pragma config WRTC = OFF // Configuration Register Write Protection bit (Configuration Words NOT write-protected) #pragma config WRTD = OFF // Data EEPROM Write Protection bit (Data EEPROM NOT write-protected) #pragma config WRTSAF = OFF // Storage Area Flash Write Protection bit (SAF NOT write-protected) #pragma config LVP = ON // Low Voltage Programming Enable bit (Low Voltage programming enabled. MCLR/Vpp pin function is MCLR.) // CONFIG5 #pragma config CP = OFF // UserNVM Program memory code protection bit (UserNVM code protection disabled) // #pragma config statements should precede project file includes. // Use project enums instead of #define for ON and OFF. #include #define _XTAL_FREQ 4000000UL // LED1 is Pin 27 // #define LED1 LATBbits.LATB6 #define LED1_TRIS TRISBbits.TRISB6 void main() { LED1 = 0; LED1_TRIS = 0; // Note that pragma sets RSTOSC = HFINT1 // Read the fine print of the OSCFRQ description, and extrapolate (Guess) // what it takes to make the clock run at 4 MHz. // Namely, you have to set HFFRQ to 0b101, not 0b010. Really. // OSCFRQbits.HFFRQ = 0b101; while (1) { LED1 ^= 1; __delay_ms(1000); } } Regards, Dave |
|
|
|
在这些新的PICS中,非常灵活的振荡器模块提供了多种方式来获得相同的Fosc。将HFIFToC设置为16MHz,并将CDIV设为DIEB-4当然给出4MHz输出。或32兆赫和/或8,或8和/或2,或使用PLL -大概6个不同的设置组合。OP发现这些组合中的一个似乎不起作用(HFIFT=4MHz,CDIV=/1)-我将选择最低功率/EMI的组合-这对我来说是一个有趣的和未解决的问题。
以上来自于百度翻译 以下为原文 The very flexible oscillator modules in these new PICs provide multiple ways to get the same Fosc. Setting HFINTOSC to 16MHz and leaving CDIV at div-by-4 certainly gives 4MHz output. Or 32MHz and /8, or 8 and /2, or use the PLL - probably 6 different setting combos. The OP found one of these combinations that didn't seem to work (HFINT = 4MHz, CDIV = /1) - the combination I would choose for lowest power/EMI - which to me was the interesting and unsolved problem. |
|
|
|
如果只有一种方法去做“某事”,生活是简单的:发现或衍生或根除,直到你走运和绊倒(或支付某人告诉你)的方式。“我没有声称”我的方式是“方式”或“最好的方式”。这是一种方式。具体来说,这是我通常做的事情:开始慢(也许做一些I/O自我测试或一些这样的事情),然后曲柄它的速度。我从1 MHz开始,“发现”了设置HFFRQ以获得4 MHz的方法。从数据表中不清楚,直到我读到字里行间。另一种方法:从32兆赫的语用开始,设置HFFRQ得到4兆赫。我们当中的好奇者(如果有人还醒着的话)可以尝试NoSC和HFFRQ的其他组合,然后把NDIV扔进去。我没有发现它很有效率,但我没有花太多的时间尝试,我没有努力。总结:两个“最简单”的方法(从我的观点来看)从HFIFToSC获得4 MHz需要一个程序指令(确保使用正确的RSTOSC语法)。艺术缓慢,然后上升。然后,在程序中的某处:2.另一种方式:快速启动然后下降。然后,在程序中的某处:在我的PIC16F1915上测试。问候,戴夫
以上来自于百度翻译 以下为原文 If there is only one way to do "something," life is simple: discover or derive or root-around-until-you-get-lucky-and-stumble-across (or pay someone to tell you) "The Way." I didn't claim "my" way is "The Way" or "The Best Way". It is a way. Specifically, it is the way I typically do things: Start slow (maybe do some I/O self tests or some such thing) then crank it up to speed. I started at 1 MHz and "discovered" the way to set HFFRQ to get 4 MHz. Wasn't perfectly clear from the data sheet until I read between the lines. Another way: Start with the pragma for 32 MHz and set HFFRQ to get 4 MHz. Neither requires mucking with NOSC or NDIV. The curious among us (if anyone is still awake) can experiment with other combinations of NOSC and HFFRQ, and throw in NDIV just for the heck of it. I didn't find it very productive, but I didn't spend much time trying, and I didn't try very hard. Summary: Two "simplest" ways (from my point of view) to get 4 MHz from HFINTOSC require one program instruction (making sure to use the correct RSTOSC pragma). 1. The way I did it in my previous posts: Start slow then go up. #pragma config RSTOSC = HFINT1 // Power-up default value for COSC bits (HFINTOSC (1MHz)) Then, somewhere in the program: OSCFRQbits.HFFRQ = 0b101; 2. Another way: Start fast and then go down. #pragma config RSTOSC = HFINT32 // Power-up default value for COSC bits (HFINTOSC with OSCFRQ= 32 MHz and CDIV = 1:1) Then, somewhere in the program: OSCFRQbits.HFFRQ = 0b010; Tested on my PIC16F1915. Regards, Dave |
|
|
|
戴夫,谢谢你的解释和示例。我安装了XC8,复制了你的代码,编译好了,工作了:闪烁和CKUUT频率显示你的价值!所以显然我的JALV2代码有问题。即使与您完全相同的配置字设置(比较HEX文件),我的16F19156的CKKOUT频率显示250kHz或8MHz,无论我为OSCFRQYHFFRQ指定了什么。汇编文件几乎没有可比性(我不太擅长PIC ASM),但在我看来,OSCFRQ的设置是等价的。我仍然担心我的编译器存在问题。对我来说,16F18856用相同的源代码工作很好。Rob。
以上来自于百度翻译 以下为原文 @davekw7x Hi Dave, Thanks for your explanations and sample. I installed XC8, copied your code, compiled and it works: blink and clkout frequencies show your values! So apparently there is something wrong in my JalV2 code. Even with exactly the same config words settings as yours (comparing the hex files) the clkout frequency of my 16f19156 shows either 250KHz or 8MHz, whatever I specify for OSCFRQ_HFFRQ. The assembler files are hardly comparable (I'm not fluently with PIC-asm), but it looks to me like the setting of OSCFRQ is equivalent. Still I fear that there is an issue with my compiler. Remains a mystery to me that a 16f18856 works fine with the same source code. Regards, Rob. |
|
|
|
问候,最后我找到了问题的原因与振荡器设置!16F19156是具有64个数据存储体的较新的PICS之一,这需要修改的MOVLB指令。原始MOVLB仅限于32个银行,“新”MOVLB允许64个银行。我在JAL编程PICS,编译器(JALV2.4Q6)似乎不支持新的MOVLB指令。因此,OSCFRQ寄存器并没有像预期的那样设置。不幸的是,64个银行的中档图片的大多数数据表仍然提到旧的MOVLB格式!但是在16F1887I的数据表中发现了新格式(对于一个6位的银行号)。在我修补了编译器——用新格式替换旧的——问题就消失了。此外,其他类似图片的“无法解释的”问题也消失了!谢谢所有试图帮助你的人,对不起浪费你的时间!问候,Rob。
以上来自于百度翻译 以下为原文 Greetings, Finally I found the cause of the problem with the oscillator setting! The 16f19156 is one of those newer PICs with 64 data memory banks.This requires a modified movlb instruction. The original movlb is limited to 32 banks, the 'new' movlb allows 64 banks. I'm programming PICs in JAL and the compiler (JalV2.4q6) appears not to support the new movlb instruction. Therefore the OSCFRQ register wasn't set as expected. Unfortunately most datasheets of the midrange PICs with 64 banks still mention the old movlb format! But the in datasheet of the 16f18877 I found the new format (for a 6 bits bank number). After I patched the compiler - replacing the old by the new format - the problem was gone. Moreover: several other 'unexplainable' problems with similar PICs were gone too! Thanks for all who tried to be of help, sorry to waste your time! Regards, Rob. |
|
|
|
只有小组成员才能发言,加入小组>>
5181 浏览 9 评论
2004 浏览 8 评论
1931 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3177 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2228 浏览 5 评论
739浏览 1评论
624浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
510浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
637浏览 0评论
535浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-27 12:06 , Processed in 1.524098 second(s), Total 107, Slave 90 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号