TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 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 (139563 times)
  2. FAT32 Library (72041 times)
  3. Network Ethernet Library (57254 times)
  4. USB Device Library (47615 times)
  5. Network WiFi Library (43219 times)
  6. FT800 Library (42556 times)
  7. GSM click (29930 times)
  8. mikroSDK (28292 times)
  9. PID Library (26930 times)
  10. microSD click (26309 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

VCP Monitor 4 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.14

mikroSDK Library: 2.0.0.0

Category: Measurements

Downloaded: 250 times

Not followed.

License: MIT license  

VCP Monitor 4 Click is a compact add-on board that represents a high-precision power monitoring system. This board features the INA239, ultra-precise digital power monitor with a 16-bit delta-sigma ADC specifically designed for current-sensing applications from Texas Instruments.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "VCP Monitor 4 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "VCP Monitor 4 Click" changes.

Do you want to report abuse regarding "VCP Monitor 4 Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


VCP Monitor 4 Click

VCP Monitor 4 Click is a compact add-on board that represents a high-precision power monitoring system. This board features the INA239, ultra-precise digital power monitor with a 16-bit delta-sigma ADC specifically designed for current-sensing applications from Texas Instruments.

vcp_monitor_4_click.png

Click Product page


Click library

  • Author : Luka Filipovic
  • Date : Jul 2021.
  • Type : SPI type

Software Support

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

Standard key functions :

  • vcpmonitor4_cfg_setup Config Object Initialization function.

    void vcpmonitor4_cfg_setup ( vcpmonitor4_cfg_t *cfg );
  • vcpmonitor4_init Initialization function.

    err_t vcpmonitor4_init ( vcpmonitor4_t *ctx, vcpmonitor4_cfg_t *cfg );
  • vcpmonitor4_default_cfg Click Default Configuration function.

    err_t vcpmonitor4_default_cfg ( vcpmonitor4_t *ctx );

Example key functions :

  • vcpmonitor4_get_vbus Get BUS voltage.

    err_t vcpmonitor4_get_vbus ( vcpmonitor4_t *ctx, float *vbus )
  • vcpmonitor4_get_current Get Current.

    err_t vcpmonitor4_get_current ( vcpmonitor4_t *ctx, float *current )
  • vcpmonitor4_get_power Get Shunt voltage.

    err_t vcpmonitor4_get_power ( vcpmonitor4_t *ctx, float *power )

Example Description

This example application showcases ability of Click board to be configured for different readings and read temperature, voltage, current and power.

The demo application is composed of two sections :

Application Init

Initialization of communication modules (SPI, UART) and additional alert pin. Reads Manufacturer and Device ID, Configurates device for reading all device measurements.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    vcpmonitor4_cfg_t vcpmonitor4_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.
    vcpmonitor4_cfg_setup( &vcpmonitor4_cfg );
    VCPMONITOR4_MAP_MIKROBUS( vcpmonitor4_cfg, MIKROBUS_1 );
    err_t init_flag  = vcpmonitor4_init( &vcpmonitor4, &vcpmonitor4_cfg );
    VCPMONITOR4_SET_DATA_SAMPLE_EDGE
    if ( SPI_MASTER_ERROR == init_flag )
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    uint32_t temp_data = 0;
    vcpmonitor4_generic_read( &vcpmonitor4, VCPMONITOR4_REG_MANUFACTURER_ID, &temp_data );
    log_printf( &logger, " > Manufacturer ID: \t0x%.4X\r\n", temp_data );

    vcpmonitor4_generic_read( &vcpmonitor4, VCPMONITOR4_REG_DEVICE_ID, &temp_data );
    log_printf( &logger, " > Device ID: \t\t0x%.4X\r\n", temp_data );

    vcpmonitor4_default_cfg ( &vcpmonitor4 );
    Delay_ms ( 1000 );
    log_info( &logger, " Application Task " );
}

Application Task

In span of 500ms reads and calculates data for IC temperature, Bus voltage in V, Shunt voltage in mV, and current and power for device.


void application_task ( void )
{
    float read_data;
    vcpmonitor4_get_temperature( &vcpmonitor4, &read_data );
    log_printf( &logger, " > Temperature:\t%.2f \r\n", read_data );

    vcpmonitor4_get_vbus( &vcpmonitor4, &read_data );
    log_printf( &logger, " > Vbus[V]:\t%.2f \r\n", read_data );

    vcpmonitor4_get_vshunt( &vcpmonitor4, &read_data );
    log_printf( &logger, " > Vshunt[mV]:\t%.2f \r\n", read_data );

    vcpmonitor4_get_current( &vcpmonitor4, &read_data );
    log_printf( &logger, " > Current[A]:\t%.2f \r\n", read_data );

    vcpmonitor4_get_power( &vcpmonitor4, &read_data );
    log_printf( &logger, " > Power[W]:\t%.2f \r\n", read_data );
    log_printf( &logger, "*************************\r\n" );

    Delay_ms ( 500 );
}

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

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

BLE2 click

10

Explore the possibilities of BLE2 click, the click board for adding a peripheral Bluetooth Low Energy device to your design. You can use this application as a starting point for developing your own apps with the provided source code.

[Learn More]

RS485 6 click

5

RS485 6 Click is offers a half-duplex RS-485 communication with integrated surge protection, which can be used as an interface between the TTL level UART and the RS485 communication bus. It is based on THVD1429DT, a transceiver from Texas Instruments with signaling rate of up to 20 Mbps.

[Learn More]

Current Limit 5 Click

0

Current Limit 5 Click is a compact add-on board representing a current-limiting solution. This board features the MIC2099, a current-limit power distribution switch from Microchip Technology. This Click board™ represents a programmable current limit solution with various protection features and fault indication, which operates from a 2.5V to 5.5V input voltage range. Also, the current limit is adjustable from 100mA up to 1.05A programmed through the MCP4561 digital potentiometer. This Click board™ is suitable for applications in portable equipment and condition monitoring or power supplies, protecting them in short circuits or other overload conditions.

[Learn More]