pac1944 2.0.0.0
|
PAC1944 Click is a compact add-on board that contains an energy monitoring solution. This board features the PAC1944, a multi-channel DC power/energy monitor from Microchip Technology. It uses real-time calibration to minimize offset and gain errors with no input filters required for this device.
We provide a library for the PAC1944 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.
pac1944_cfg_setup
Config Object Initialization function. pac1944_init
Initialization function. pac1944_default_cfg
Click Default Configuration function. pac1944_setup_config
PAC1944 setup config function. pac1944_refresh_cmd
PAC1944 refresh command. pac1944_get_calc_measurement
PAC1944 get calculated measurement function. This demo application shows an example of measuring voltage, current and power in a selected part of the circuit. Note that PAC1944 is a high side power monitor, therefore the desired channel should be connected accordingly.
The demo application is composed of two sections :
Initialization of I2C module, log UART and additional pins. In addition, a default configuration is performed as followed:
- Sample mode is 1024, adaptive accumulation;
- INT pin is set as an alert;
- SLW pin is set as slow sampling rate control;
- All channels are on;
- Channel 1 is set for bipolar measurements;
- Channel 2 is set for bipolar measurements reduced by half;
- Channel 3 and 4 are set for unipolar measurements.
The application sends a refresh command which stores the measurement data in registers. Measurements are acquired for voltage, current and power on channel 1 of PAC1944 click board. The last 8 measurements are averaged and calculated in bipolar mode. Process is repeated every two seconds.
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:
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.