2.17 PGA Driver
Overview
The Programmable Gain Amplifier (PGA) is an op amp-based, non-inverting amplifier with user programmable gains. The output of the PGA can be connected to a number of dedicated Sample-and-Hold inputs of the Analog-to-Digital Converter (ADC) and/or to the high-speed analog comparator module.
The PGA has multiple selectable gains and may be used as a ground referenced amplifier (single-ended) or as an amplifier with an independent ground reference.
Features
- Single-Ended or Independent Ground Reference.
- Selectable Gains: 4x, 8x, 16x and 32x (and 6x,12x, 24x and 48x with the 1.5 gain).
- High gain bandwidth.
- Rail-to-rail output voltage.
- Wide input voltage range
2.17.1 Module Documentation
2.17.1.1 PGA Driver
The PGA is an op amp-based, noninverting amplifier with user-programmable gains. The output of the PGA can be connected to a number of dedicated Sample-and-Hold inputs of the Analog-to-Digital Converter and/or to the high-speed analog comparator module.
2.17.1.1.1 Module description
The PGA is an op amp-based, noninverting amplifier with user-programmable gains. The output of the PGA can be connected to a number of dedicated Sample-and-Hold inputs of the Analog-to-Digital Converter and/or to the high-speed analog comparator module.
Data structures
struct PGA_INTERFACE
Structure containing the function pointers of PGA driver.
Enumerations
enum PGA_GAIN { PGA_GAIN_32x = 5, PGA_GAIN_16x = 4, PGA_GAIN_8x = 3, PGA_GAIN_4x = 2 }
This defines the gain enumeration for PGA.
Functions
void PGA1_Initialize (void)
Initializes the PGA1 module.
void PGA1_Deinitialize (void)
Deinitializes the PGA1 to POR values.
static void PGA1_Enable (void)
This inline function enables the PGA1 module.
static void PGA1_Disable (void)
This inline function disables the PGA1 module.
static void PGA1_GainSet (enum PGA_GAIN gainValue)
Sets gain for PGA.
Variables
const struct PGA_INTERFACE PGA1
Structure object of type PGA_INTERFACE with the custom name given by the user in the Melody Driver User interface.
2.17.1.1.2 Function Documentation
PGA1_Deinitialize()
void PGA1_Deinitialize (void )
Deinitializes the PGA1 to POR values.
none |
none |
PGA1_Disable()
inline static void PGA1_Disable (void )
This inline function disables the PGA1 module.
none |
none |
PGA1_Enable()
inline static void PGA1_Enable (void )
This inline function enables the PGA1 module.
The PGA1_Initialize function should be called before calling this function. |
none |
none |
PGA1_GainSet()
inline static void PGA1_GainSet (enum PGA_GAIN gainValue)
Sets gain for PGA.
in | gainValue |
- mask value of the gain. |
none |
PGA1_Initialize()
void PGA1_Initialize (void )
Initializes the PGA1 module.
none |
none |
2.17.1.1.3 Enumeration Type Documentation
PGA_GAIN
enum PGA_GAIN
This defines the gain enumeration for PGA.
PGA_GAIN_32x |
PGA_GAIN_32x Assigned to mask value 5 |
PGA_GAIN_16x |
PGA_GAIN_16x Assigned to mask value 4 |
PGA_GAIN_8x |
PGA_GAIN_8x Assigned to mask value 3 |
PGA_GAIN_4x |
PGA_GAIN_4x Assigned to mask value 2 |
2.17.1.1.4 Variable Documentation
PGA1
const struct PGA_INTERFACE PGA1
Structure object of type PGA_INTERFACE with the custom name given by the user in the Melody Driver User interface.
The default name e.g. PGA1 can be changed by the user in the PGA user interface. This allows defining a structure with application specific name using the 'Custom Name' field. Application specific name allows the API Portability.
2.17.2 Class Documentation
2.17.2.1 PGA_INTERFACE Struct Reference
Structure containing the function pointers of PGA driver.
2.17.2.1.1 Detailed Description
Structure containing the function pointers of PGA driver.
#include <pga_interface.h>
Public Attributes
void(* Intitialize )(void)
Pointer to PGAx_Initialize e.g. PGA1_Initialize.
void(* Deintitialize )(void)
Pointer to PGAx_Deinitialize e.g. PGA1_Deinitialize.
void(* Enable )(void)
Pointer to PGAx_Enable e.g. PGA1_Enable.
void(* Disable )(void)
Pointer to PGAx_Disable e.g. PGA1_Disable.
void(* GainSet )(enum PGA_GAIN gainValue)
Pointer to PGAx_GainSet e.g. PGA1_GainSet.
2.17.2.1.2 Member Data Documentation
Deintitialize
void(* Deintitialize) (void)
Pointer to PGAx_Deinitialize e.g. PGA1_Deinitialize.
Disable
void(* Disable) (void)
Pointer to PGAx_Disable e.g. PGA1_Disable.
Enable
void(* Enable) (void)
Pointer to PGAx_Enable e.g. PGA1_Enable.
GainSet
void(* GainSet) (enum PGA_GAIN gainValue)
Pointer to PGAx_GainSet e.g. PGA1_GainSet.
Intitialize
void(* Intitialize) (void)
Pointer to PGAx_Initialize e.g. PGA1_Initialize.
2.17.3 File Documentation
2.17.3.1 source/pga1.h File Reference
#include <xc.h> #include <stdint.h> #include "pga_types.h" #include "pga_interface.h"
2.17.3.1.1 Functions
void PGA1_Initialize (void)
Initializes the PGA1 module.
void PGA1_Deinitialize (void)
Deinitializes the PGA1 to POR values.
static void PGA1_Enable (void)
This inline function enables the PGA1 module.
static void PGA1_Disable (void)
This inline function disables the PGA1 module.
static void PGA1_GainSet (enum PGA_GAIN gainValue)
Sets gain for PGA.
2.17.3.1.2 Variables
const struct PGA_INTERFACE PGA1
Structure object of type PGA_INTERFACE with the custom name given by the user in the Melody Driver User interface.
2.17.3.2 source/pga_interface.h File Reference
#include "pga_types.h"
2.17.3.2.1 Data structures
struct PGA_INTERFACE
Structure containing the function pointers of PGA driver.
2.17.3.2.2 Detailed Description
PGA Generated Driver Interface Header File
2.17.3.3 source/pga_types.h File Reference
This is the generated driver types header file for the PGA driver.
2.17.3.3.1 Enumerations
enum PGA_GAIN { PGA_GAIN_32x = 5, PGA_GAIN_16x = 4, PGA_GAIN_8x = 3, PGA_GAIN_4x = 2 }
This defines the gain enumeration for PGA.
2.17.3.3.2 Detailed Description
This is the generated driver types header file for the PGA driver.
PGA Generated Driver Types Header File