pll 2.0.0.0
Main Page

PLL click

‍PLL click is a frequency multiplier which uses the Phase-Locked Loop (PLL) techniques to provide a high-frequency clock output from a cheap, standard fundamental mode crystal oscillator.

click Product page


Click library

  • Author : MikroE Team
  • Date : Dec 2019.
  • Type : GPIO type

Software Support

We provide a library for the Pll Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

‍This library contains API for Pll Click driver.

Standard key functions :

  • pll_cfg_setup Config Object Initialization function.
    void pll_cfg_setup ( pll_cfg_t *cfg );
    void pll_cfg_setup(pll_cfg_t *cfg)
    Config Object Initialization function.
    Click configuration structure definition.
    Definition pll.h:112
  • pll_init Initialization function.
    err_t pll_init ( pll_t *ctx, pll_cfg_t *cfg );
    err_t pll_init(pll_t *ctx, pll_cfg_t *cfg)
    Initialization function.
    Click ctx object definition.
    Definition pll.h:98

Example key functions :

Examples Description

‍This app sets PLL signals.

The demo application is composed of two sections :

Application Init

‍Initializes device.

void application_init ( void )
{
log_cfg_t log_cfg;
pll_cfg_t cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, "---- Application Init ----" );
// Click initialization.
pll_cfg_setup( &cfg );
PLL_MAP_MIKROBUS( cfg, MIKROBUS_1 );
pll_init( &pll, &cfg );
}
#define PLL_CLOCK_ENABLE
Definition pll.h:83
#define PLL_MAP_MIKROBUS(cfg, mikrobus)
Definition pll.h:65
void application_init(void)
Definition main.c:32

Application Task

‍Every 2 seconds, the PLL increases the input clock from min (x2) to max (x8) level.

void application_task ( void )
{
log_printf( &logger, " PLL level: x2\r\n\n" );
pll_set_pll_2x( &pll );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " PLL level: x3\r\n\n" );
pll_set_pll_3x( &pll );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " PLL level: x3.125\r\n\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " PLL level: x4\r\n\n" );
pll_set_pll_4x( &pll );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " PLL level: x5\r\n\n" );
pll_set_pll_5x( &pll );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " PLL level: x5.3125\r\n\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " PLL level: x6\r\n\n" );
pll_set_pll_6x( &pll );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " PLL level: x6.25\r\n\n" );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
log_printf( &logger, " PLL level: x8\r\n\n" );
pll_set_pll_8x( &pll );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
void pll_set_pll_5_3125x(pll_t *ctx)
Functions for settings PLL clock x5.3125.
void pll_set_pll_3x(pll_t *ctx)
Functions for settings PLL x3.
void pll_set_pll_2x(pll_t *ctx)
Functions for settings PLL x2.
void pll_set_pll_6_25x(pll_t *ctx)
Functions for settings PLL clock x6.25.
void pll_set_pll_8x(pll_t *ctx)
Functions for settings PLL x6.
void pll_set_pll_3_125x(pll_t *ctx)
Functions for settings PLL clock x3.125.
void pll_set_pll_5x(pll_t *ctx)
Functions for settings PLL x5.
void application_task(void)
Definition main.c:57

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Pll

Additional notes and informations

Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.