TOP Contributors

  1. MIKROE (2659 codes)
  2. Alcides Ramos (356 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 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 (136993 times)
  2. FAT32 Library (70112 times)
  3. Network Ethernet Library (56027 times)
  4. USB Device Library (46347 times)
  5. Network WiFi Library (41964 times)
  6. FT800 Library (41286 times)
  7. GSM click (29053 times)
  8. mikroSDK (26489 times)
  9. PID Library (26447 times)
  10. microSD click (25413 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

Analog MUX 5 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.7

mikroSDK Library: 2.0.0.0

Category: Measurements

Downloaded: 50 times

Not followed.

License: MIT license  

Analog MUX 5 Click is a compact add-on board that switches one of many inputs to one output. This board features the MAX4634, a fast, low-voltage four-channel CMOS analog multiplexer from Analog Devices. This low-voltage multiplexer operates from both mikroBUS™ power rails and features 4Ω maximum ON-resistance (RON). CMOS switch construction allows the processing of analog signals within the supply voltage range. It is also characterized by an easy way of management, only through a couple of signals from the mikroBUS™ socket. This Click board™ is suitable for various applications, from industrial and instrumentation to medical, consumer, communications, and more.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Analog MUX 5 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Analog MUX 5 click" changes.

Do you want to report abuse regarding "Analog MUX 5 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Analog MUX 5 click

Analog MUX 5 Click is a compact add-on board that switches one of many inputs to one output. This board features the MAX4634, a fast, low-voltage four-channel CMOS analog multiplexer from Analog Devices. This low-voltage multiplexer operates from both mikroBUS™ power rails and features 4Ω maximum ON-resistance (RON). CMOS switch construction allows the processing of analog signals within the supply voltage range. It is also characterized by an easy way of management, only through a couple of signals from the mikroBUS™ socket. This Click board™ is suitable for various applications, from industrial and instrumentation to medical, consumer, communications, and more.

analogmux5_click.png

click Product page


Click library

  • Author : Nikola Peric
  • Date : Apr 2022.
  • Type : ADC type

Software Support

We provide a library for the Analog MUX 5 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 Analog MUX 5 Click driver.

Standard key functions :

  • analogmux5_cfg_setup Config Object Initialization function.

    void analogmux5_cfg_setup ( analogmux5_cfg_t *cfg );
  • analogmux5_init Initialization function.

    err_t analogmux5_init ( analogmux5_t *ctx, analogmux5_cfg_t *cfg );
  • analogmux5_default_cfg Click Default Configuration function.

    err_t analogmux5_default_cfg ( analogmux5_t *ctx );

Example key functions :

  • analogmux5_enable Analog MUX 5 enable function.

    void analogmux5_enable ( analogmux5_t *ctx );
  • analogmux5_select_ch Analog MUX 5 set channel function.

    err_t analogmux5_select_ch ( analogmux5_t *ctx, uint8_t ch_select );
  • analogmux5_read_an_pin_voltage Analog MUX 5 read AN pin voltage level function.

    err_t analogmux5_read_an_pin_voltage ( analogmux5_t *ctx, float *data_out );

Example Description

This example showcases how to initialize, configure and use the Analog MUX 5 click module.

The demo application is composed of two sections :

Application Init

Initializes the driver and enables the analog inputs.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    analogmux5_cfg_t analogmux5_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.
    analogmux5_cfg_setup( &analogmux5_cfg );
    ANALOGMUX5_MAP_MIKROBUS( analogmux5_cfg, MIKROBUS_1 );
    if ( ADC_ERROR == analogmux5_init( &analogmux5, &analogmux5_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( ANALOGMUX5_ERROR == analogmux5_default_cfg ( &analogmux5 ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

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

Application Task

This is an example that shows the use of a Analog MUX 5 click board In this example, we switch from channel AN1 to channel AN4, read and display the analog value and voltage on the active channel. Results are being sent to the Usart Terminal where you can track their changes.


void application_task ( void ) 
{
    float analogmux5_an_voltage = 0;

    analogmux5_select_ch( &analogmux5, ANALOGMUX5_SEL_CH_1 );
    Delay_ms ( 100 );

    if ( ADC_ERROR != analogmux5_read_an_pin_voltage ( &analogmux5, &analogmux5_an_voltage ) ) 
    {
        log_printf( &logger, " Channel [ 1 ] ---> AN Voltage : %.3f[V]\r\n\n", analogmux5_an_voltage );
    }

    analogmux5_select_ch( &analogmux5, ANALOGMUX5_SEL_CH_2 );
    Delay_ms ( 100 );

    if ( ADC_ERROR != analogmux5_read_an_pin_voltage ( &analogmux5, &analogmux5_an_voltage ) ) 
    {
        log_printf( &logger, " Channel [ 2 ] ---> AN Voltage : %.3f[V]\r\n\n", analogmux5_an_voltage );
    }

    analogmux5_select_ch( &analogmux5, ANALOGMUX5_SEL_CH_3 );
    Delay_ms ( 100 );

    if ( ADC_ERROR != analogmux5_read_an_pin_voltage ( &analogmux5, &analogmux5_an_voltage ) ) 
    {
        log_printf( &logger, " Channel [ 3 ] ---> AN Voltage : %.3f[V]\r\n\n", analogmux5_an_voltage );
    }

    analogmux5_select_ch( &analogmux5, ANALOGMUX5_SEL_CH_4 );
    Delay_ms ( 100 );

    if ( ADC_ERROR != analogmux5_read_an_pin_voltage ( &analogmux5, &analogmux5_an_voltage ) ) 
    {
        log_printf( &logger, " Channel [ 4 ] ---> AN Voltage : %.3f[V]\r\n\n", analogmux5_an_voltage );
    }
    Delay_ms ( 1000 );
}

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.AnalogMUX5

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

AudioAmp 5 click

0

AudioAmp 5 Click is a stereo audio amplifier, capable of delivering up to 10W per channel with the 8Ω load.

[Learn More]

nvSRAM click

5

nvSRAM Click is a compact add-on board that contains the most reliable nonvolatile memory. This board features the CY14B101J, a 1-Mbit nvSRAM organized as 128K words of 8 bits each with a nonvolatile element in each memory cell from Cypress Semiconductor.

[Learn More]

ECG 3 click

6

ECG 3 click is a complete solution for the development of ECG applications, which utilizes a specialized clinical-grade biopotential analog front-end (AFE) IC. ECG 3 click is an ideal solution for the development of heart rate monitoring applications, fitness applications, for the ECG bio-authentication, and similar applications.

[Learn More]