<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.heepy.net/index.php?action=history&amp;feed=atom&amp;title=PIC24_clock_setup</id>
	<title>PIC24 clock setup - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.heepy.net/index.php?action=history&amp;feed=atom&amp;title=PIC24_clock_setup"/>
	<link rel="alternate" type="text/html" href="https://www.heepy.net/index.php?title=PIC24_clock_setup&amp;action=history"/>
	<updated>2026-04-30T09:20:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://www.heepy.net/index.php?title=PIC24_clock_setup&amp;diff=1247&amp;oldid=prev</id>
		<title>Morris: Created page with &quot;&lt;pre&gt; ew.   config word FOSCSEL selects which oscillator.  each oscillator option can be with or without PLL (which multiplies by 4) The builtin RC oscillator is 8mhz, so  FNOSC_…&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.heepy.net/index.php?title=PIC24_clock_setup&amp;diff=1247&amp;oldid=prev"/>
		<updated>2012-01-17T08:40:44Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; ew.   config word FOSCSEL selects which oscillator.  each oscillator option can be with or without PLL (which multiplies by 4) The builtin RC oscillator is 8mhz, so  FNOSC_…&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
ew. &lt;br /&gt;
&lt;br /&gt;
config word FOSCSEL selects which oscillator. &lt;br /&gt;
each oscillator option can be with or without PLL (which multiplies by 4)&lt;br /&gt;
The builtin RC oscillator is 8mhz, so &lt;br /&gt;
FNOSC_FRC is 8mhz, and FNOSC_FRCPLL is 32mhz. &lt;br /&gt;
&lt;br /&gt;
THEN, there's a postscaler. CLKDIVbits.RCDIV sets the divide-by. 0 means&lt;br /&gt;
don't. &lt;br /&gt;
&lt;br /&gt;
NOTE: The default setting of the postscaler is DIVIDE BY TWO. If you don't&lt;br /&gt;
want it to halve the clock freq, you have to set CLKDIVbits.RCDIV=0 early&lt;br /&gt;
in the program.&lt;br /&gt;
&lt;br /&gt;
THEN, whatever the output of all the above, is divided by two. &lt;br /&gt;
&lt;br /&gt;
For example&lt;br /&gt;
_FOSCSEL(FNOSC_FRC)&lt;br /&gt;
CLKDIVbits.RCDIV = 0;&lt;br /&gt;
gives the builtin 8mhz oscillator, not divided by a postscaler, and&lt;br /&gt;
finally divided by two = 4MHz. &lt;br /&gt;
&lt;br /&gt;
_FOSCSEL(FNOSC_FRCPLL) &lt;br /&gt;
gives builtin 8mhz, times 4 (pll) = 32MHz, divided by 2 = 16 MHz. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
UART BAUD RATE SETTINGS. &lt;br /&gt;
&lt;br /&gt;
Builtin RC oscillator @ 8MHZ, PLL enabled, CLKDIV=0 = system clock at 16MHz&lt;br /&gt;
&lt;br /&gt;
_FOSCSEL(FNOSC_FRCPLL)&lt;br /&gt;
CLKDIVbits.RCDIV = 0;&lt;br /&gt;
U1MODEbits.BRGH = 1;&lt;br /&gt;
&lt;br /&gt;
9600bps: U1BRG=416&lt;br /&gt;
19200bps: U1BRG=207&lt;br /&gt;
38400bps: U1BRG=103&lt;br /&gt;
57600bps: U1BRG=70&lt;br /&gt;
115200bps: U1BRG=34&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Morris</name></author>
	</entry>
</feed>