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: 2021-06-04
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Measurements
Downloaded: 1725 times
Not followed.
License: MIT license
PAC1954 Click is a compact add-on board that contains an energy monitoring solution. This board features the PAC1954, a four-channel DC power/energy monitor from Microchip Technology.
Library Description
The library covers all the necessary functions to control the PAC1954 click board.
Key functions:
void pac1954_single_write( uint8_t reg_addr, uint8_t data_in )
- This function writes a single data byte to the selected register.void pac1954_refresh_cmd( void )
- float pac1954_get_calc_measurement( uint8_t meas_sel, uint8_t ch_sel, uint8_t avg_sel, uint8_t meas_mode )
- Examples description
The application is composed of three sections :
void application_task ( ) { pac1954_refresh_cmd( ); vsource = pac1954_get_calc_measurement( PAC1954_MEAS_SEL_V_SOURCE, PAC1954_CH_SEL_CH_1, PAC1954_AVG_SEL_ENABLE, PAC1954_MEAS_MODE_BIPOLAR_FSR ); isense = pac1954_get_calc_measurement( PAC1954_MEAS_SEL_I_SENSE, PAC1954_CH_SEL_CH_1, PAC1954_AVG_SEL_ENABLE, PAC1954_MEAS_MODE_BIPOLAR_FSR ); power = pac1954_get_calc_measurement( PAC1954_MEAS_SEL_P_SENSE, PAC1954_CH_SEL_CH_1, PAC1954_NULL, PAC1954_MEAS_MODE_BIPOLAR_FSR ); FloatToStr( vsource, log_txt ); Ltrim( log_txt ); float_cut( ); mikrobus_logWrite( "V(source) is ", _LOG_TEXT ); mikrobus_logWrite( log_txt, _LOG_TEXT ); mikrobus_logWrite( " V", _LOG_LINE ); FloatToStr( isense, log_txt ); Ltrim( log_txt ); float_cut( ); mikrobus_logWrite( "I(sense) is ", _LOG_TEXT ); mikrobus_logWrite( log_txt, _LOG_TEXT ); mikrobus_logWrite( " A", _LOG_LINE ); FloatToStr( power, log_txt ); Ltrim( log_txt ); float_cut( ); mikrobus_logWrite( "P(sense) is ", _LOG_TEXT ); mikrobus_logWrite( log_txt, _LOG_TEXT ); mikrobus_logWrite( " W", _LOG_LINE ); mikrobus_logWrite( "", _LOG_LINE ); Delay_ms( 1000 ); }
Other mikroE Libraries used in the example:
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.
ADAC 3 Click is a compact add-on board representing the ADC/DAC combo solution. This board features the PCF8591, a low-power 8-bit CMOS data acquisition device with four analog inputs, one analog output, and a serial I2C interface from NXP Semiconductors. The PCF8591 includes analog input multiplexing, an on-chip track and hold function and 8-bit analog-to-digital conversion alongside an 8-bit digital-to-analog conversion. In addition, the user is given the option to select the PCF8591 reference voltage value, choosing between 2,048 and 4,096V.
[Learn More]LEM Click carries the LTS 6-NP current transducer and MCP3201 ADC converter. The Click can measure AC and DC current with exceptional speed, up to 200 KHz.
[Learn More]Angle 5 Click is a compact add-on board that detects the absolute angular position of a permanent magnet, typically a diametrically magnetized cylinder on a rotating shaft.
[Learn More]You have unsaved changes. If you choose to leave all changes will be discarded.
Do you want to subscribe in order to receive notifications regarding "PAC1954 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "PAC1954 click" changes.
Do you want to report abuse regarding "PAC1954 click".