This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
pic16f1455_oscillators [2019/10/06 10:31] 60.240.96.191 [Using PLL to achieve 24MHz] |
pic16f1455_oscillators [2021/01/27 21:05] sausage [Using the internal oscillator] |
||
---|---|---|---|
Line 26: | Line 26: | ||
===== Using the internal oscillator ===== | ===== Using the internal oscillator ===== | ||
- | Rather than use an external oscillator, use the internal one. There are two way to do this. You can either declare this at the top of your code with: | + | Rather than use an external oscillator, use the internal one. There are two ways to do this. You can either declare this at the top of your code with: |
#pragma config FOSC = INTOSC // INTOSC = Internal Oscillator | #pragma config FOSC = INTOSC // INTOSC = Internal Oscillator | ||
Line 143: | Line 143: | ||
#define _XTAL_FREQ 17664000UL //17.664MHz | #define _XTAL_FREQ 17664000UL //17.664MHz | ||
+ | |||
+ | Ensure the PLL is off to ensure good timing: | ||
+ | |||
+ | #pragma config PLLEN = 0 //Turn off PLL | ||
And finally, the only ''OSCCON'' register setting you need is: | And finally, the only ''OSCCON'' register setting you need is: |