4.7 OSC - Clock Controller

4.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

4.7.2 Supported Device Families

PIC12/16F150xPIC12/16F157xPIC12/16F161x
PIC12/16F184xPIC12/16LF155xPIC16F145x
PIC16F151xPIC16F152xPIC16F152xx
PIC16F153xxPIC16F170xPIC16F171x
PIC16F171xxPIC16F176xPIC16F177x
PIC16F178xPIC16F180xxPIC16F181xx
PIC16F183xxPIC16F184xxPIC16F188xx
PIC16F191xxPIC16F194xPIC16LF156x
PIC16LF190xPIC18F-K20PIC18F-K40
PIC18F-K42PIC18F-K50PIC18F-K83
PIC18F-Q10PIC18F-Q20PIC18F-Q24
PIC18F-Q40PIC18F-Q41PIC18F-Q43
PIC18F-Q71PIC18F-Q83PIC18F-Q84

4.7.3 Required header files:

#include "mcc_generated_files/system/clock.h"

4.7.4 Module Documentation

4.7.4.1 Clock Driver

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

4.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.4 Package Version 4.3.6
Functions
  • void CLOCK_Initialize (void)

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

4.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.

4.7.5 File Documentation

4.7.5.1 source/clock.c File Reference

This file contains the API prototypes for the Clock driver.

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

4.7.5.1.1 Functions

  • void CLOCK_Initialize (void)

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

4.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.4 Package Version 4.3.6

4.7.5.2 source/clock.h File Reference

4.7.5.2.1 Functions

  • void CLOCK_Initialize (void)

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

4.7.5.2.3 Detailed Description

CLOCK Generated Driver Header File

4.7.5.2.4 Macro Definition Documentation

_XTAL_FREQ

#define _XTAL_FREQ 1000000