How does it work?
Clock Gen 6 Click as its foundation uses the MIC1557, a low-power digital frequency solution providing the logic for creating a simple RC oscillator circuit from Microchip Technology. The MIC1557 offers rail-to-rail pulses for precise frequency generation alongside a single threshold and trigger connection, internally connected, for astable (oscillator) operation only with programmable output frequency and enable/reset control signal intended as an oscillator with a Shutdown capability.
As mentioned before, the astable oscillator switches between two states, ON and OFF, producing a continuous square wave. The MIC1557 is optimized for this function by tying the two comparator inputs together, the threshold and trigger pins (THR and TRG), forming a T/T pin. The external capacitor charges slowly through the external resistor presented in the form of a digital potentiometer by which the user can pass through the frequency range and thus adjust the desired output.
By replacing the resistor with a digital potentiometer, the user can easily program frequency output as performed on this Click board™. For this purpose, the digital potentiometer MAX5401, which communicates with the MCU via 3-Wire SPI serial interface, is used to set the resistance on the MIC1557 OUT line, adjusting the frequency up to 5MHz.
Alongside SPI communication, this Click board™ also uses one additional pin. The Enable pin, labeled as EN and routed to the RST pin of the mikroBUS™ socket, optimizes power consumption and is used for power ON/OFF purposes (controls the bias supply to the oscillator’s internal circuitry). When the MIC1557 is deselected, the supply current is less than 1μA, and the device is placed in a Shutdown state. Forcing the EN pin low resets the device by setting the flip flop, causing the output to a low logic state.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
Clock generator
Applications
Can be used for applications such as pulse generation, precision timer, time-delay generation, and more
On-board modules
MIC1557 – RC oscillator from Microchip Technology
Key Features
Low power consumption, high precision, astable oscillator operation, programmable output, enable/reset feature, and more
Interface
GPIO,SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on Clock Gen 6 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
Clock Gen 6 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Frequency Range | – | – | 5 | MHz |
Operating Temperature Range | -40 | +25 | +85 | °C |
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.
Key functions
-
clockgen6_set_digipot
This function sets the digital potentiometer position by using SPI serial interface. -
clockgen6_enable_output
This function enables the output by setting the EN pin to high logic state. -
clockgen6_disable_output
This function disables the output by setting the EN pin to low logic state.
Example Description
This example demonstrates the use of Clock Gen 6 Click board™ which acts as an astable oscillator.
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: %urn", 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.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.