Experience the power of precise and low-voltage analog data switching for uncompromised audio, video, data-acquisition applications, and many more
A
A
Hardware Overview
How does it work?
Analog MUX 5 Click is based on the MAX4634, a low-on-resistance, low-voltage analog multiplexer from Analog Devices. CMOS switch construction of the MAX4634 allows the processing of analog signals within its supply voltage range. It features 4Ω maximum ON-resistance (RON) and offers RON matching between switches to 0.3Ω maximum and RON flatness of 1Ω maximum over the specified signal range. Also, all digital inputs have +0.8V and +2.4V logic thresholds, ensuring TTL/CMOS-logic compatibility with +5V operation. This Click board™ communicates with MCU using several GPIO pins.
It can be enabled or disabled through the EN pin routed to the CS pin of the mikroBUS™ socket, hence, offering a switch operation to turn ON/OFF power delivery to the MAX4634. It also provides two address signals, labeled as A0 and A1 and routed to the PWM and INT pins of the mikroBUS™ socket, that determine the activation of the desired analog input channel based on their setup while monitoring of that input analog signal is done using AN pin of the mikroBUS™ socket. Each analog input has a jumper for its hardware activation or deactivation from R3 to R6 and capacitors for additional filtering of the input
channels from C3 to C6. Proper power-supply sequencing is recommended for all CMOS devices. Before applying analog signals or logic inputs, always apply the power supply first, especially if the analog or logic signals are not current-limited. This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the VCC SEL jumper. This way, both 3.3V and 5V capable MCUs can 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.
Features overview
Development board
PIC18F57Q43 Curiosity Nano evaluation kit is a cutting-edge hardware platform designed to evaluate microcontrollers within the PIC18-Q43 family. Central to its design is the inclusion of the powerful PIC18F57Q43 microcontroller (MCU), offering advanced functionalities and robust performance. Key features of this evaluation kit include a yellow user LED and a responsive
mechanical user switch, providing seamless interaction and testing. The provision for a 32.768kHz crystal footprint ensures precision timing capabilities. With an onboard debugger boasting a green power and status LED, programming and debugging become intuitive and efficient. Further enhancing its utility is the Virtual serial port (CDC) and a debug GPIO channel (DGI
GPIO), offering extensive connectivity options. Powered via USB, this kit boasts an adjustable target voltage feature facilitated by the MIC5353 LDO regulator, ensuring stable operation with an output voltage ranging from 1.8V to 5.1V, with a maximum output current of 500mA, subject to ambient temperature and voltage constraints.
Microcontroller Overview
MCU Card / MCU
Architecture
PIC
MCU Memory (KB)
128
Silicon Vendor
Microchip
Pin count
48
RAM (Bytes)
8196
You complete me!
Accessories
Curiosity Nano Base for Click boards is a versatile hardware extension platform created to streamline the integration between Curiosity Nano kits and extension boards, tailored explicitly for the mikroBUS™-standardized Click boards and Xplained Pro extension boards. This innovative base board (shield) offers seamless connectivity and expansion possibilities, simplifying experimentation and development. Key features include USB power compatibility from the Curiosity Nano kit, alongside an alternative external power input option for enhanced flexibility. The onboard Li-Ion/LiPo charger and management circuit ensure smooth operation for battery-powered applications, simplifying usage and management. Moreover, the base incorporates a fixed 3.3V PSU dedicated to target and mikroBUS™ power rails, alongside a fixed 5.0V boost converter catering to 5V power rails of mikroBUS™ sockets, providing stable power delivery for various connected devices.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Schematic
Step by step
Project assembly
Track your results in real time
Application Output
After loading the code example, pressing the "DEBUG" button builds and programs it on the selected setup.
After programming is completed, a header with buttons for various actions available in the IDE appears. By clicking the green "PLAY "button, we start reading the results achieved with Click board™.
Upon completion of programming, the Application Output tab is automatically opened, where the achieved result can be read. In case of an inability to perform the Debug function, check if a proper connection between the MCU used by the setup and the CODEGRIP programmer has been established. A detailed explanation of the CODEGRIP-board connection can be found in the CODEGRIP User Manual. Please find it in the RESOURCES section.
Software Support
Library Description
This library contains API for Analog MUX 5 Click driver.
Key functions:
analogmux5_cfg_setup
- Config Object Initialization function.analogmux5_init
- Initialization function.analogmux5_default_cfg
- Click Default Configuration function.
Open Source
Code example
This example can be found in NECTO Studio. Feel free to download the code, or you can copy the code below.
/*!
* @file main.c
* @brief Analog MUX 5 Click 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.
*
* ## 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 voltage on the active channel.
* Results are being sent to the Usart Terminal where you can track their changes.
*
*
* @author Nikola Peric
*
*/
#include "board.h"
#include "log.h"
#include "analogmux5.h"
static analogmux5_t analogmux5; /**< Analog MUX 5 Click driver object. */
static log_t logger; /**< Logger object. */
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 " );
}
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 );
}
int main ( void )
{
/* Do not remove this line or clock might not be set correctly. */
#ifdef PREINIT_SUPPORTED
preinit();
#endif
application_init( );
for ( ; ; )
{
application_task( );
}
return 0;
}
// ------------------------------------------------------------------------ END