5.7 OSC - Clock Controller

5.7.1 Introduction

The MPLAB® Code Configurator (MCC) Melody Oscillator Module (OSC) Peripheral Library (PLIB) generates APIs to support OSC-specific peripheral functionality on PIC18F and PIC16F devices.

The oscillator module contains multiple clock sources and selection features that allow it to be used in a wide range of applications while maximizing performance and minimizing power consumption

5.7.2 Supported Device Families

PIC12/16F150x PIC12/16F157x PIC12/16F161x
PIC12/16F184x PIC12/16LF155x PIC16F145x
PIC16F151x PIC16F152x PIC16F152xx
PIC16F153xx PIC16F170x PIC16F171x
PIC16F171xx PIC16F176x PIC16F177x
PIC16F178x PIC16F180xx PIC16F181xx
PIC16F183xx PIC16F184xx PIC16F188xx
PIC16F191xx PIC16F194x PIC16LF156x
PIC16LF190x PIC18F-K20 PIC18F-K40
PIC18F-K42 PIC18F-K50 PIC18F-K83
PIC18F-Q10 PIC18F-Q20 PIC18F-Q24
PIC18F-Q40 PIC18F-Q41 PIC18F-Q43
PIC18F-Q71 PIC18F-Q83 PIC18F-Q84

5.7.3 Required header files:

#include "mcc_generated_files/system/clock.h"

5.7.4 Module Documentation

5.7.4.1 Clock Driver

This file contains the API prototypes and other data types for the Clock driver.

5.7.4.1.1 Module description

This file contains the API prototypes and other data types for the Clock driver.

Version: Driver Version 2.0.3
Functions
  • void CLOCK_Initialize (void)

    Initializes all the Internal Oscillator sources and the clock switch configurations.

5.7.4.1.2 Function Documentation

CLOCK_Initialize()

void CLOCK_Initialize (void )

Initializes all the Internal Oscillator sources and the clock switch configurations.

Parameters:
None.
Returns:

None.

5.7.5 File Documentation

5.7.5.1 source/clock.c File Reference

This file contains the API prototypes for the Clock driver.

#include <xc.h>
#include "../clock.h"

5.7.5.1.1 Functions

  • void CLOCK_Initialize (void)

    Initializes all the Internal Oscillator sources and the clock switch configurations.

5.7.5.1.2 Detailed Description

This file contains the API prototypes for the Clock driver.

CLOCK Generated Driver Source File

Version: Driver Version 2.0.3

5.7.5.2 source/clock.h File Reference

5.7.5.2.1 Functions

  • void CLOCK_Initialize (void)

    Initializes all the Internal Oscillator sources and the clock switch configurations.

5.7.5.2.3 Detailed Description

CLOCK Generated Driver Header File

5.7.5.2.4 Macro Definition Documentation

_XTAL_FREQ

#define _XTAL_FREQ 1000000