PICPilot 2.1
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Autopilot
Common
clock.c
Go to the documentation of this file.
1
2
/*
3
* File: clock.c
4
* Author: Chris Hajduk
5
*
6
* Created on September 8, 2015, 11:16 PM
7
*/
8
#include "../AttitudeManager/main.h"
9
#include "
clock.h
"
10
11
void
useFRCPLLClock
(){
12
// Configure PLL prescaler, PLL postscaler, PLL divisor
13
PLLFBD = 41;
// M = 43
14
CLKDIVbits.PLLPOST=0;
// N2 = 2
15
CLKDIVbits.PLLPRE=0;
// N1 = 2
16
// Initiate Clock Switch to Internal FRC with PLL (NOSC = 0b001)
17
__builtin_write_OSCCONH(0x01);
18
__builtin_write_OSCCONL(0x01);
19
// Wait for Clock switch to occur
20
while
(OSCCONbits.COSC != 0b001);
21
// Wait for PLL to lock
22
while
(OSCCONbits.LOCK != 1) {};
23
}
clock.h
useFRCPLLClock
void useFRCPLLClock()
Definition:
clock.c:11
Generated on Sun Mar 5 2017 00:02:40 for PICPilot by
1.8.7