TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (91 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139266 times)
  2. FAT32 Library (71754 times)
  3. Network Ethernet Library (57128 times)
  4. USB Device Library (47432 times)
  5. Network WiFi Library (43092 times)
  6. FT800 Library (42408 times)
  7. GSM click (29835 times)
  8. mikroSDK (28101 times)
  9. PID Library (26886 times)
  10. microSD click (26198 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Clock Gen 6 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.7

mikroSDK Library: 2.0.0.0

Category: Clock generator

Downloaded: 140 times

Not followed.

License: MIT license  

Clock Gen 6 Click is a compact add-on board representing a digital oscillator solution. This board features the MIC1557, an IttyBitty CMOS RC oscillator designed to provide rail-to-rail pulses for precise time delay or frequency generation from Microchip Technology. The MIC1557 has a single threshold and trigger connection, internally connected, for astable (oscillator) operation only. It also has an enable/reset control signal routed to the RST pin of the mikroBUS™ socket, which controls the bias supply to the oscillator’s internal circuitry and optimizes power consumption used for oscillator power ON/OFF purposes. In addition, it provides the ability to select the desired frequency programmed via a digital potentiometer, the MAX5401.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Clock Gen 6 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Clock Gen 6 Click" changes.

Do you want to report abuse regarding "Clock Gen 6 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Clock Gen 6 Click

Clock Gen 6 Click is a compact add-on board representing a digital oscillator solution. This board features the MIC1557, an IttyBitty CMOS RC oscillator designed to provide rail-to-rail pulses for precise time delay or frequency generation from Microchip Technology. The MIC1557 has a single threshold and trigger connection, internally connected, for astable (oscillator) operation only. It also has an enable/reset control signal routed to the RST pin of the mikroBUS™ socket, which controls the bias supply to the oscillator’s internal circuitry and optimizes power consumption used for oscillator power ON/OFF purposes. In addition, it provides the ability to select the desired frequency programmed via a digital potentiometer, the MAX5401.

clockgen6_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Dec 2021.
  • Type : SPI type

Software Support

We provide a library for the Clock Gen 6 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for Clock Gen 6 Click driver.

Standard key functions :

  • clockgen6_cfg_setup Config Object Initialization function.

    void clockgen6_cfg_setup ( clockgen6_cfg_t *cfg );
  • clockgen6_init Initialization function.

    err_t clockgen6_init ( clockgen6_t *ctx, clockgen6_cfg_t *cfg );
  • clockgen6_default_cfg This function executes a default configuration of Clock Gen 6 Click board.

    err_t clockgen6_default_cfg ( clockgen6_t *ctx );

Example key functions :

  • clockgen6_set_digipot This function sets the digital potentiometer position by using SPI serial interface.

    err_t clockgen6_set_digipot ( clockgen6_t *ctx, uint8_t position );
  • clockgen6_enable_output This function enables the output by setting the EN pin to high logic state.

    void clockgen6_enable_output ( clockgen6_t *ctx );
  • clockgen6_disable_output This function disables the output by setting the EN pin to low logic state.

    void clockgen6_disable_output ( clockgen6_t *ctx );

Example Description

This example demonstrates the use of Clock Gen 6 Click board which acts as an astable oscillator.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the Click default configuration which sets the digital potentiometer to max position and enables the clock output.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    clockgen6_cfg_t clockgen6_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    clockgen6_cfg_setup( &clockgen6_cfg );
    CLOCKGEN6_MAP_MIKROBUS( clockgen6_cfg, MIKROBUS_1 );
    if ( DIGITAL_OUT_UNSUPPORTED_PIN == clockgen6_init( &clockgen6, &clockgen6_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( CLOCKGEN6_ERROR == clockgen6_default_cfg ( &clockgen6 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );
}

Application Task

Changes the clock output frequency by changing the digital potentiometer position every second. The potentiometer position value will be displayed on the USB UART.

void application_task ( void )
{
    for ( int16_t pos = CLOCKGEN6_DIGIPOT_POSITION_MAX; pos >= CLOCKGEN6_DIGIPOT_POSITION_MIN; )
    {
        if ( CLOCKGEN6_OK == clockgen6_set_digipot ( &clockgen6, pos ) )
        {
            log_printf( &logger, " DIGIPOT position: %u\r\n", pos );
            Delay_ms ( 1000 );
            pos -= 5;
        }
    }
}

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.ClockGen6

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. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

RFid Click - Example

0

This is a sample program which demonstrates the use of the ST's CR95HF contactless transceiver. The CR95HF is used in the applications such as near field communication (NFC) using 13.56 MHz wireless interface. In this example, when the RFid tag is put over the RFid Click antenna, the tag ID will be displayed on the TFT display.

[Learn More]

DC Motor 5 Click

0

DC MOTOR 5 Click carries the DRV8701 brushed DC motor gate driver from Texas Instruments.

[Learn More]

DC Motor 15 click

5

DC Motor 15 Click is a compact add-on board that contains a motor driver with current sense and regulation. This board features the DRV8874, an integrated motor driver with N-channel H-bridge, charge pump, current sensing, and adjustment from Texas Instruments.

[Learn More]