Experience efficient conversion of input voltages to desired negative levels while benefiting from the dynamic buck-boost capability that ensures stability and accuracy, enabling reliable operation across various applications
A
A
Hardware Overview
How does it work?
MCP16331 INV Click is based on the MCP16331, a step-down (buck) switching regulator from Microchip. However, with the help of a few external components, MCP16331 INV Click can regulate voltage levels lower and higher than the input voltage, working as an inverted boost-buck voltage regulator. The MCP16331 INV click is designed to output a negative voltage with respect to the GND. A negative voltage is often used in the analog electronics domain to power up devices requiring both positive and negative voltages. A good example would be an operational amplifier (opamp) which amplifies an AC signal. The signal goes in both positive and negative directions with respect to the GND. Processing this kind of signal using a single voltage source is difficult and requires workarounds such as capacitors, charge pumps, and virtual GNDs. Using a symmetrical power supply reduces the required components and simplifies the design. Several additional components, such as the ADM8828 voltage inverter IC and the LM318, a dual operational amplifier, must be added to deliver a negative voltage. The ADM8828 voltage inverter IC provides a negative component of the symmetrical power supply used for the LM318 dual opamp. One integrated opamp from the LM318 IC is used to invert the output from the DAC.
The other opamp from the LM318 IC is used to invert the output from the voltage divider, located on the output rail of the MCP16331, so that it can be used by the MCU, which uses a single voltage power source. To set the output voltage of the MCP16331 INV click, the MCP4921 - a low-power 12-Bit dual voltage output DAC is used in the feedback loop. As already mentioned, it is necessary to invert this signal as the MCP4921 is supplied from a single-voltage power supply, and it cannot bring the signal lower than the GND. Since MCP16331 works in the negative voltage domain, the feedback voltage applied to the FB pin of this IC also needs to be negative with respect to the GND. One of the LM318's integrated opamps, configured as a unity gain inverter, is used to invert the DAC output voltage. Since the DAC drives the FB pin of the MCP16331 IC, it is enough to set the DAC to a specific value to control the output voltage of the click board™. Communication with the MCP4921 DAC is done via the SPI interface. SPI bus pins of the MCP4921 are routed to the mikroBUS™ for an easy and secure connection with the host MCU. The AN pin of the mikroBUS™ is routed to a middle point of a voltage divider at the output. This voltage divider is used to scale down the output voltage so the ADC of the host MCU can successfully convert it.
The voltage on the divider also has to be inverted since it is coming out from the negative voltage domain. This is achieved by the second operational amplifier of the LM318 IC, which also works as a unity gain inverter. This value can be used to monitor and correct the output voltage if needed. The EN pin of the MCP16331 switching regulator is routed to the mikroBUS™ RST pin. By pulling this pin to a HIGH logic level, the internal sections of the regulator are enabled. The EN pin is internally pulled to a HIGH logic level, so the device will be enabled, even if this pin is left floating. Therefore, a correct startup sequence must be used to avoid undesirable effects (in the NOTE below). Although it is designed to work as the negative power supply, the MCP16331INV click can also be used to drive a regular load, connecting its positive input terminal to the GND of the click board™ and using the negative output of the MCP16331INV click as the GND. MCP16331 INV Click with two screw terminals to connect the input and the output voltage rails. This click board™ uses only +5V rail from the mikroBUS™. Provided libraries demonstrate the functionality of the MCP16331 INV click and offer an easy and simple way of setting it up.
Features overview
Development board
EasyPIC v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports many high pin count 8-bit PIC microcontrollers from Microchip, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, EasyPIC v8 provides a fluid and immersive working experience, allowing access anywhere and under any
circumstances at any time. Each part of the EasyPIC v8 development board contains the components necessary for the most efficient operation of the same board. In addition to the advanced integrated CODEGRIP programmer/debugger module, which offers many valuable programming/debugging options and seamless integration with the Mikroe software environment, the board also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via the USB Type-C (USB-C) connector.
Communication options such as USB-UART, USB DEVICE, and CAN are also included, including the well-established mikroBUS™ standard, two display options (graphical and character-based LCD), and several different DIP sockets. These sockets cover a wide range of 8-bit PIC MCUs, from the smallest PIC MCU devices with only eight up to forty pins. EasyPIC v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU

Architecture
PIC
MCU Memory (KB)
64
Silicon Vendor
Microchip
Pin count
40
RAM (Bytes)
3968
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Track your results in real time
Application Output
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support
Library Description
This library contains API for MCP16331 INV Click driver.
Key functions:
mcp16331inv_enable_vin
- This function enables or disables internal VIN pull upmcp16331inv_set_dac_vout
- This function determines DAC output voltage valuemcp16331inv_generic_transfer
- Generic SPI transfer, for sending and receiving packages
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* \file
* \brief Mcp16331Inv Click example
*
* # Description
* This application enables usage of this click as a buck-boost voltage regulator.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes click driver and enables VIN Pull Up.
*
* ## Application Task
* Sets DAC output voltage on 3500mV, when gain is set up on 1x VREF,
* on 4s delay time, and then sets DAC output voltage on 5000mV, when gain is now set up on 2x VREF,
* on also 4s delay time. VIN Pull Up voltage must be greater than 4V.
*
*
* \author MikroE Team
*
*/
// ------------------------------------------------------------------- INCLUDES
#include "board.h"
#include "log.h"
#include "mcp16331inv.h"
// ------------------------------------------------------------------ VARIABLES
static mcp16331inv_t mcp16331inv;
static log_t logger;
// ------------------------------------------------------ APPLICATION FUNCTIONS
void application_init ( void )
{
log_cfg_t log_cfg;
mcp16331inv_cfg_t cfg;
/**
* 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.
mcp16331inv_cfg_setup( &cfg );
MCP16331INV_MAP_MIKROBUS( cfg, MIKROBUS_1 );
Delay_ms( 100 );
mcp16331inv_init( &mcp16331inv, &cfg );
Delay_ms( 100 );
mcp16331inv_enable_vin( &mcp16331inv, MCP16331INV_ENABLE_VIN_PULL_UP );
}
void application_task ( void )
{
// Task implementation.
mcp16331inv_set_dac_vout( &mcp16331inv, MCP16331INV_3500_MV_1X_GAIN, MCP16331INV_GAIN_1X_VREF, MCP16331INV_ACTIVE_MODE );
Delay_ms( 4000 );
mcp16331inv_set_dac_vout( &mcp16331inv, MCP16331INV_5000_MV_2X_GAIN, MCP16331INV_GAIN_2X_VREF, MCP16331INV_ACTIVE_MODE );
Delay_ms( 4000 );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END