TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 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 (137101 times)
  2. FAT32 Library (70236 times)
  3. Network Ethernet Library (56126 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42077 times)
  6. FT800 Library (41389 times)
  7. GSM click (29116 times)
  8. mikroSDK (26562 times)
  9. PID Library (26503 times)
  10. microSD click (25487 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 3 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.14

mikroSDK Library: 2.0.0.0

Category: Measurements

Downloaded: 104 times

Not followed.

License: MIT license  

Analog MUX 3 Click is a compact add-on board that switches one of the eight inputs to one output. This board features the ADG738, a CMOS analog matrix switch with a serially-controlled SPI interface from Analog Devices. In an active state, the ADG738 conducts equally well in both directions, making it suitable for multiplexing and demultiplexing applications. It can also be configured as a type of switch array where any, all, or none of eight switches may be closed any time. All channels exhibit ‘break-before-make switching action, preventing momentary shorting when switching channels. This Click board™ is suitable for a wide range of applications, from industrial and instrumentation to medical, consumer, communications, and automotive systems.

No Abuse Reported

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

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

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

  • Information
  • Comments (0)

mikroSDK Library Blog


Analog MUX 3 click

Analog MUX 3 Click is a compact add-on board that switches one of the eight inputs to one output. This board features the ADG738, a CMOS analog matrix switch with a serially-controlled SPI interface from Analog Devices. In an active state, the ADG738 conducts equally well in both directions, making it suitable for multiplexing and demultiplexing applications. It can also be configured as a type of switch array where any, all, or none of eight switches may be closed any time. All channels exhibit ‘break-before-make switching action, preventing momentary shorting when switching channels. This Click board™ is suitable for a wide range of applications, from industrial and instrumentation to medical, consumer, communications, and automotive systems.

analog_mux_3_click.png

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Mar 2021.
  • Type : SPI type

Software Support

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

Standard key functions :

  • analogmux3_cfg_setup Config Object Initialization function.

    void analogmux3_cfg_setup ( analogmux3_cfg_t *cfg );
  • analogmux3_init Initialization function.

    ANALOGMUX3_RETVAL analogmux3_init ( analogmux3_t *ctx, analogmux3_cfg_t *cfg );
  • analogmux3_default_cfg Click Default Configuration function.

    void analogmux3_default_cfg ( analogmux3_t *ctx );

Example key functions :

  • analogmux3_generic_write Analog MUX 3 data writing function.

    err_t analogmux3_generic_write ( analogmux3_t *ctx, uint8_t data_in );
  • analogmux3_set_channel Analog MUX 3 set channel function.

    err_t analogmux3_set_channel ( analogmux3_t *ctx, uint8_t mux_ch );
  • analogmux3_read_an_pin_voltage Analog MUX 3 read AN pin voltage level function.

    err_t analogmux3_read_an_pin_voltage ( analogmux3_t *ctx, float *data_out );

Example Description

This is an example that demonstrates the use of the Analog MUX 3 click board. This application controls the multiplexing of a single input channel with an eight-channel matrix switch.

The demo application is composed of two sections :

Application Init

Initializes SPI and ADC driver, set Vref, STM32F407ZG - 2.048 V, PIC18F97J94 3.3 V, set the default configuration and start to write log.


void application_init ( void ) {
    log_cfg_t log_cfg;                /**< Logger config object. */
    analogmux3_cfg_t analogmux3_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.

    analogmux3_cfg_setup( &analogmux3_cfg );
    ANALOGMUX3_MAP_MIKROBUS( analogmux3_cfg, MIKROBUS_1 );

    // Vref STM32F407ZG
    analogmux3_cfg.vref = 2.048;

    // Vref PIC18F97J94
    // analogmux3_cfg.vref = 3.3;

    err_t init_flag  = analogmux3_init( &analogmux3, &analogmux3_cfg );
    if ( init_flag == SPI_MASTER_ERROR ) {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    analogmux3_default_cfg ( &analogmux3 );
    log_info( &logger, " Application Task " );
    Delay_ms ( 100 );
}

Application Task

This is an example that shows the use of a Analog MUX 3 click board. In this example, we switch from channel AN0 to channel AN7, 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 ) {
    for ( uint8_t ch_pos = ANALOGMUX3_SET_CHANNEL_0; ch_pos <= ANALOGMUX3_SET_CHANNEL_7; ch_pos++ ) {
        analogmux3_set_channel( &analogmux3, ch_pos );
        Delay_ms ( 1000 );

        uint16_t analogmux3_an_value = 0;

        log_printf( &logger, "   CHANNEL    : AN%u     \r\n", ch_pos );
        log_printf( &logger, "- - - - - - - - - - - - - \r\n" );

        if ( analogmux3_read_an_pin_value ( &analogmux3, &analogmux3_an_value ) != ADC_ERROR ) {
            log_printf( &logger, "   ADC Value  : %u\r\n", analogmux3_an_value );
        }

        float analogmux3_an_voltage = 0;

        if ( analogmux3_read_an_pin_voltage ( &analogmux3, &analogmux3_an_voltage ) != ADC_ERROR ) {
            log_printf( &logger, "   AN Voltage : %.3f V \r\n", analogmux3_an_voltage );
        }

        log_printf( &logger, "-------------------------\r\n" );
    }   
}

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

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.


ALSO FROM THIS AUTHOR

RMS to DC 2 click

0

RMS to DC 2 Click is a compact add-on board that converts the RMS of the input signal into a DC voltage. This board features the AD8436, a low-cost, low-power, true RMS-to-DC converter from Analog Devices. The AD8436 is a translinear precision, low-power, true RMS-to-DC converter that delivers true RMS or average rectified value of AC waveform. It features high accuracy, a wide dynamic input range (100μV rms to 3V rms), a wide bandwidth of up to 1MHz, and more. This Click board™ makes the perfect solution for the development of various true RMS digital multimeter applications, panel meters and gauges, AC + DC measurement applications, a true RMS measurement of an audio signal, and other similar applications that require accurate RMS value readings.

[Learn More]

Ecg 6 click

0

ECG 6 Click is a complete solution for the development of ECG and Heart-Rate (HR) applications. It features the MAX86150, a Reflective Heart Rate Monitor and Medical-Grade Pulse Oximeter from Maxim Integrated. The Click board™ contain integrated electrocardiogram, pulse oximeter, heart rate monitor sensor module. The ECG 6 Click can be used for application in Fitness Assistant Devices, Wearable Devices, Smartphones, Tablet.

[Learn More]

Silent Step Click

5

Silent Step Click is the complete integrated bipolar step motor driver solution, rich with many features that allow extremely smooth and silent operation of the connected motor while being able to provide up to 2.5A peak motor current and withstand up to 46V supply voltage.

[Learn More]