How does it work?
VREG Click is based on the LM317M, an adjustable voltage regulator from STMicroelectronics. It is a reliable regulator with typical line regulation of 0.01% and load regulation of 0.1%. It also has internal short-circuit current limiting and thermal overload protection. Because of the heat dissipation while regulating the voltage, the board’s operating range is defined by two factors. The maximum input voltage and current should not exceed 20V/0.5A, and the maximum wattage arising from the current and I/O voltage difference should not exceed 1W, measured as I x (Input V – Output V).
The VREG Click uses MCP3204, a 4-channel 12-bit ADC with an SPI interface from Microchip, to get the information of the output voltage of the LM317M voltage regulator, output voltage after it passes the switch MOSFET and the input voltage no matter if it is external or internal. For that purpose, the MCP3204 uses voltage dividers. It also uses the MAX6106, a low-cost, micropower, low-dropout, high-output-current voltage reference from Analog Devices, as a 2.048V voltage reference.
This Click board™ uses the MCP4921, a 12-bit DAC with an SPI interface, to set the desired voltage. This DAC includes an input amplifier, rail-to-rail amplifier, shutdown, reset-management circuitry, and a reference buffer fed by a MAX6106. The output from the DAC passes to the LM358, a low-power, dual-operational amplifier from Texas Instruments. This Op-Amp fed the LM317M voltage regulator with a precise value over the adjustment pin. This Click board™ features the ZXMP7A17K, a P-channel MOSFET from Zetex Semiconductors, as a switch to toggle the output on and off, which can be controlled over the host MCU.
To communicate with the host MCU, the VREG Click uses an SPI serial interface with separate chip select pins (CS for MCP4921 and CS2 for MCP3204). Pin SW acts as a switch over a MOSFET to toggle the output on and off. The input voltage can be used as external over the screw terminal or internal from the host board itself, depending on the set voltage over the PWR SEL selection jumper. The external and internal voltage inputs can be selected over the INPUT SEL jumper, with an external set by default.
This Click board™ can operate with either 3.3V or 5V logic voltage levels selected via the PWR 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.
Specifications
Type
Linear
Applications
Can be used for the development of applications based on regulating linear power supplies for a wide variety of devices
On-board modules
LM317M – adjustable voltage regulator from STMicroelectronics
MCP3204 – 12-bit ADC with an SPI interface from Microchip
MAX6106 – micropower, low-dropout, high-output-current, voltage reference from Analog Devices
MCP4921 – 12-bit DAC with an SPI interface
LM358 – low-power, dual-operational amplifier from Texas Instruments
Key Features
External voltage output regulation, internal voltage output regulation, maximum input DC voltage and current 20V/0.5A, reliable linear regulator, 12-bit DAC and ADC, external power supply screw terminal, output screw terminal, MOSFET as a switch to toggle the output on and off, and more
Interface
SPI
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
L (57.15 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on VREG Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1 | INPUT SEL | Right | Input Voltage Selection VCC/EXT: Left position VCC, Right position EXT |
JP2 | PWR SEL | Left | Power Voltage Level Selection 3V3/5V: Left position 3V3, Right position 5V |
VREG Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Maximum Input Voltage | – | – | 20 | VDC |
Maximum Input Current | – | – | 0.5 | A |
Software Support
We provide a library for the VREG 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), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for VREG Click driver.
Key functions
-
Get ADC value function.
-
Set output voltage function.
-
Set output voltage procentage function.
Example Description
This is an example that demonstrates the use of VREG click board.
void application_task ( void )
{
ch_reg = vreg_get_adc( &vreg, VREG_CHANNEL_0 );
voltage = ch_reg / 182.0;
log_printf( &logger, " CH Reg : %.2f Vrn", voltage );
Delay_10ms( );
ch_in = vreg_get_adc( &vreg, VREG_CHANNEL_2 );
voltage = ch_in / 182.0;
log_printf( &logger, " CH In : %.2f Vrn", voltage );
Delay_10ms( );
ch_out = vreg_get_adc( &vreg, VREG_CHANNEL_1 );
voltage = ch_out / 182.0;
log_printf( &logger, " CH Out : %.2f Vrn", voltage );
Delay_1sec( );
log_printf( &logger, " ---------------------- rn" );
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager (recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.Vreg
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.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.