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]
Rating:
Author: MIKROE
Last Updated: 2018-06-22
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Buck
Downloaded: 4641 times
Not followed.
License: MIT license
VREG 2 click is a voltage regulator click, with outstanding performances. It has a steady output voltage with the ripple lower than 5mV, short circuit protection with the LED indicator, and high efficiency with minimal power dissipation.
Do you want to subscribe in order to receive notifications regarding "VREG 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "VREG 2 click" changes.
Do you want to report abuse regarding "VREG 2 click".
This library provides parsing functions that will allow a user to control the voltage output by inputting user-defined parameters.
Key functions:
void vreg2_workParameters(uint8_t setA, uint8_t setB, uint8_t setC, uint8_t setD)
- Function for setting work parameters for setting the output voltage in %.int8_t vreg2_incHandler(uint8_t *in);
- If the setA parameter has been received this function will return the value of 1.int8_t vreg2_decHandler(uint8_t *in);
- If the setB parameter has been received this function will return the value of -1.uint8_t vreg2_printHandler(uint16_t *pwm);
- This function returns flags based on the internal parser state.Examples Description
The application is composed of three sections:
void applicationTask() { if( UART_Rdy_Ptr() ) { rxDat[0] = UART_Rd_Ptr(); vreg2_eventTick(); } pwmDuty += vreg2_incHandler( &rxDat ); pwmDuty += vreg2_decHandler( &rxDat ); vreg2_parseInput( &rxDat, &parseVoltage[0] , &pwmDuty ); temp = vreg2_printHandler( &pwmDuty ); if( temp == VREG2_VOLTAGE_SET ) { WordToStr( pwmDuty, text ); mikrobus_logWrite( "Voltage set to : ", _LOG_TEXT ); mikrobus_logWrite( text, _LOG_TEXT ); mikrobus_logWrite( " %", _LOG_LINE ); } if( temp == VREG2_BACKSPACE_PRESSED_HANDLE ) { mikrobus_logWrite( " ", _LOG_LINE ); mikrobus_logWrite( parseVoltage, _LOG_TEXT ); } if( temp == VREG2_CHARACTER_RECEIVED ) { mikrobus_logWrite(rxDat,_LOG_TEXT); } if( temp == VREG2_NUMBER_PARSER_ENABLED ) { mikrobus_logWrite( "Insert value from 1 to 99%", _LOG_LINE ); } vreg2_set( pwmDuty ); rxDat[0] = 0; }
Additional Functions:
void vreg2_set(uint16_t pwmIn)
- Set's the PWM output from 0 to 100%.void vreg2_pwmInit()
- Initializes the PWM peripheral.The full application code, and ready to use projects can be found on our Libstock page.
Other mikroE Libraries used in the example:
Additional notes and information
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.