Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example
OSCILLATOR_SYSTEM_FREQUENCIES_s Struct Reference

Global data structure holding system frequencies of different clock domains. More...

#include <common/p33c_pral/p33c_osc.h>

+ Collaboration diagram for OSCILLATOR_SYSTEM_FREQUENCIES_s:

Data Fields

volatile uint32_t frc
 
volatile uint32_t fpri
 
volatile uint32_t fclk
 
volatile uint32_t fosc
 
volatile uint32_t fcy
 
volatile uint32_t fp
 
volatile uint32_t fpllo
 
volatile uint32_t fvco
 
volatile float tp
 
volatile float tcy
 
volatile uint32_t afpllo
 
volatile uint32_t afvco
 

Detailed Description

Global data structure holding system frequencies of different clock domains.

The data structure "system_frequencies" of type OSCILLATOR_SYSTEM_FREQUENCIES_t is used to broadcast most recent system frequencies of multiple clock domains. Contents of this data structure are NOT updated automatically.

The function p33c_Osc_GetFrequencies() must be called from user code to update/refresh the contents of this data structure every time a oscillator configuration has been changed.

Example:

The following code lines initialize the internal FRC oscillator for 100 MIPS operation and the auxiliary PLL for 500 MHz to support 250ps resolution of the PWM module. After both configurations have been set, the function 'osc_get_frequencies()' is used to update the most recent frequencies of multiple clock domains.

init_FRCCLK_Defaults(CPU_SPEED_100_MIPS); // Initialize FRC for 100 MIPS operation
init_AUXCLK_500MHz(); // Initialize AuxPLL for 500 MHz clock output
osc_get_frequencies(0); // Update system frequencies data structure
Note
When an external oscillator is used, the function osc_get_frequencies() must be called to set the external frequency value in [Hz] and update all related frequencies accordingly. If only the internal FRC oscillator is used, this parameter should be set = 0.

Definition at line 125 of file p33c_osc.h.

Field Documentation

◆ afpllo

volatile uint32_t afpllo

Definition at line 136 of file p33c_osc.h.

◆ afvco

volatile uint32_t afvco

Definition at line 137 of file p33c_osc.h.

◆ fclk

volatile uint32_t fclk

Definition at line 128 of file p33c_osc.h.

◆ fcy

volatile uint32_t fcy

Definition at line 130 of file p33c_osc.h.

◆ fosc

volatile uint32_t fosc

Definition at line 129 of file p33c_osc.h.

◆ fp

volatile uint32_t fp

Definition at line 131 of file p33c_osc.h.

◆ fpllo

volatile uint32_t fpllo

Definition at line 132 of file p33c_osc.h.

◆ fpri

volatile uint32_t fpri

Definition at line 127 of file p33c_osc.h.

◆ frc

volatile uint32_t frc

Definition at line 126 of file p33c_osc.h.

◆ fvco

volatile uint32_t fvco

Definition at line 133 of file p33c_osc.h.

◆ tcy

volatile float tcy

Definition at line 135 of file p33c_osc.h.

◆ tp

volatile float tp

Definition at line 134 of file p33c_osc.h.


The documentation for this struct was generated from the following file: