The LMK04828 Clock PLL Calculation Program is an auxiliary tool for quickly configuring TI (Texas Instruments) high-performance clock generator chip LMK04828. The program greatly simplifies the design process of complex clock trees by automatically calculating phase-locked loop (PLL) parameters, divider settings, and output clock configurations. Compared to traditional design processes, this program can complete rapid configuration calculation and configuration on the embedded side, and perform on-site calculation and writing of configurations. It is suitable for scenarios requiring multiple low-jitter clocks such as communications, test equipment, and radar systems.
| Structure | Description |
|---|---|
| LMK_Simple | Clock tree parameter requirement structure. |
| LMK_Generated | Clock tree key clock node parameter structure. |
| LMK_Config | Clock tree register and interface parameter structure. |
| LMK_RegMap | Clock tree register table. |
| LMK_ClockPair | Clock tree output channel register table. |
| LMK_ReadBack | Clock tree status readback structure. |
The figure below shows the relationships between the various structures.
First include the relevant header files and declare the required structures.
#include "LMK_ClockTree.h"
LMK_Config LMK_inst;
LMK_Simple LMK_simple;
Set the reference clock rate in Hz.
// Set reference clock rate
LMK_simple.RefClockRate = 30720000;
Set the VCOX clock rate in Hz.
// Set expected VCO clock rate
LMK_simple.VCOXClockRate = 122880000;
Set the SYSREF clock rate in Hz.
// Set SYSREF
LMK_simple.SYSREFRate = 7680000;
Set the output clock rate in Hz. Setting to 0 disables the corresponding channel, default is disabled.
// DClockRate[n] for DCLKout(2n), the SDCLKout(2n+1) are all set to SYSREF
LMK_simple.DClockRate[0] = 491520000;
LMK_simple.DClockRate[1] = 491520000;
LMK_simple.DClockRate[2] = 491520000;
Configure the interface pointer.
// Config the interface instance for LMK
LMK_simple.InterfaceInst = &SPI_inst;
Calculate register values based on configuration data.
// Generate config using LMK_simple
LMK_ConfigMake(&LMK_inst, &LMK_simple);
Initialize registers.
// Download to LMK
LMK_Init(&LMK_inst);
__weak int LMK_CalPLL1CommonRate(LMK_Simple *SimpleConfig)
__weak int LMK_CalPLL2CommonRate(LMK_Simple *SimpleConfig)
__weak int LMK_CalRegister(LMK_Simple *SimpleConfig)
__weak int LMK_ConfigSetRegister(LMK_Config *DevConfig, LMK_Simple *SimpleConfig)
__weak int LMK_ConfigPreset(LMK_Config *DevConfig, LMK_Simple *SimpleConfig)
__weak int LMK_ConfigCustomize(LMK_Config *DevConfig, LMK_Simple *SimpleConfig)
__weak int LMK_ConfigMake(LMK_Config *DevConfig, LMK_Simple *SimpleConfig)
int LMK_Init(LMK_Config *DevConfig)
__weak int LMK_StatusRead(LMK_Config *DevConfig)
int LMK_RegLock(LMK_Config *DevConfig)
int LMK_RegUnlock(LMK_Config *DevConfig)
__weak int LMK_WriteReg(LMK_Config *DevConfig, u16 RegisterAddress, u8 Value)
__weak int LMK_ReadReg(LMK_Config *DevConfig, u16 RegisterAddress, u8 *Value)