3.17 NCO - Numerically Controlled Oscillator
3.17.1 Introduction
The MPLAB® Code Configurator (MCC) Melody Numerically Controlled Oscillator Peripheral Library (PLIBs) drivers generates APIs to support NCO-specific peripheral functionality on target MCUs.
The Numerically Controlled Oscillator (NCO) module is a timer that uses overflow from the addition of an increment value to divide the input frequency. The advantage of the addition method over a simple counter driven timer is that the output frequency resolution does not vary with the divider value. The NCO is most useful for applications that require frequency accuracy and fine resolution at a fixed duty cycle.
3.17.2 Supported Device Families
PIC12/16F150x | PIC12/16F184x | PIC16F153xx |
PIC16F171x | PIC16F171xx | PIC16F180xx |
PIC16F181xx | PIC16F183xx | PIC16F184xx |
PIC16F188xx | PIC18F-K42 | PIC18F-K83 |
PIC18F-Q24 | PIC18F-Q40 | PIC18F-Q41 |
PIC18F-Q43 | PIC18F-Q71 | PIC18F-Q83 |
PIC18F-Q84 |
3.17.3 Required header files
#include "mcc_generated_files/nco/nco[X].h"
3.17.4 Module Documentation
3.17.4.1 NCOx
This file contains the API prototypes for the NCOx driver.
3.17.4.1.1 Module description
This file contains the API prototypes for the NCOx driver.
Functions
void NCOx_Initialize (void)
Initializes the NCOx module. This routine must be called once before any other NCOx APIs.
void NCOx_ISR (void)
Implements the Interrupt Service Routine (ISR) for the NCOx module interrupts.
bool NCOx_GetOutputStatus (void)
Returns the NCOx output level.
3.17.4.1.2 Function Documentation
NCOx_GetOutputStatus()
bool NCOx_GetOutputStatus (void )
Returns the NCOx output level.
NCOx_Initialize() is already called. |
|
|
NCOx_Initialize()
void NCOx_Initialize (void )
Initializes the NCOx module. This routine must be called once before any other NCOx APIs.
|
None. |
NCOx_ISR()
void NCOx_ISR (void )
Implements the Interrupt Service Routine (ISR) for the NCOx module interrupts.
|
None. |
3.17.5 File Documentation
3.17.5.1 source/ncox.c File Reference
This file contains the API implementation for the NCOx driver.
#include <xc.h> #include "../ncox.h"
3.17.5.1.1 Functions
void NCOx_Initialize (void)
Initializes the NCOx module. This routine must be called once before any other NCOx APIs.
void NCOx_ISR (void)
Implements the Interrupt Service Routine (ISR) for the NCOx module interrupts.
bool NCOx_GetOutputStatus (void)
Returns the NCOx output level.
3.17.5.1.2 Detailed Description
This file contains the API implementation for the NCOx driver.
NCOx Generated Driver File.
3.17.5.2 source/ncox.h File Reference
#include <xc.h> #include <stdbool.h> #include <stdint.h>
3.17.5.2.1 Functions
void NCOx_Initialize (void)
Initializes the NCOx module. This routine must be called once before any other NCOx APIs.
void NCOx_ISR (void)
Implements the Interrupt Service Routine (ISR) for the NCOx module interrupts.
bool NCOx_GetOutputStatus (void)
Returns the NCOx output level.
3.17.5.2.2 Detailed Description
NCOx Generated Driver API Header File.