TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137109 times)
  2. FAT32 Library (70237 times)
  3. Network Ethernet Library (56129 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42079 times)
  6. FT800 Library (41390 times)
  7. GSM click (29118 times)
  8. mikroSDK (26564 times)
  9. PID Library (26503 times)
  10. microSD click (25487 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

PAC1921 click

Rating:

5

Author: MIKROE

Last Updated: 2018-02-06

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Measurements

Downloaded: 4668 times

Not followed.

License: MIT license  

PAC1921 click is a versatile power monitoring and measuring device intended for the high speed, low latency measurements. This device can measure current, voltage or the power of the connected load.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "PAC1921 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "PAC1921 click" changes.

Do you want to report abuse regarding "PAC1921 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

PAC1921 click

PAC1921 click

Native view of the PAC1921 Click board.

View full image
PAC1921 click

PAC1921 click

Front and back view of the PAC1921 Click board.

View full image

Library description

Initializes click driver functions and I2C bus driver. Offers options for single or block writing to registers and reading from registers. Also offers options for calculating power and different types of voltage in a different number of samples and different full-scale range. For more details check the documentation.

Key functions

float pac1921_getMeasurementData( const uint8_t data_type, const uint8_t nSamples, const uint8_t full_scale ) - The function returns measurement data determined by the data_type parameter, which can be VSENSE (max 100mV), VBUS (max 32V) in mV, or VPOWER (max 320W) witch unit is W. One round of measurement consists of the determined number of samples.

void pac1921_blockReadReg( uint8_t register_address, uint8_t *data_buffer, uint8_t nBytes ) - The function reads bytes from registers to buffer with start location determined by the register_address parameter.

void pac1921_singleWriteReg( uint8_t register_address, uint8_t transfer_data ) - The function writes one byte of data to the register, determined by the parameter of the function.

The application is composed of three sections :

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes click driver.
  • Application Task - (code snippet) - Gets VBUS measurement data which is measured in 512 samples.
    Results are logged on the USB UART and measurement are repeated every 500ms.
void applicationTask()
{
    data_read = pac1921_getMeasurementData( _PAC1921_VBUS_FREE_RUN, _PAC1921_512_SAMPLES );

    FloatToStr( data_read, text );
    mikrobus_logWrite( text, _LOG_TEXT );
    if ( _PAC1921_UNIT == 0 )
    {
        mikrobus_logWrite( " mV", _LOG_LINE );
    }
    else
    {
        mikrobus_logWrite( " W", _LOG_LINE );
    }

    Delay_ms( 500 );
}


MikroElektronika Libraries used in the example:

  • Conversions
  • I2C
  • UART

Additional notes and information

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

AD-SWIO click

5

AD-SWIO Click is a quad-channel software configurable input/output solution based on AD74412R, for building and process control application. The AD74412R is a quad-channel software configurable input/output solution for building and process control applications.

[Learn More]

Silent Step 2 click

0

Silent Step 2 Click is a compact add-on board that allows extremely smooth and silent operation of the connected motor. This board features the TMC2130, a high-performance two-phase stepper motor driver from Analog Devices. The driver uses an external motor power supply of 4.75 up to 43V to power a 2-phase stepper motor up to 2A coil current (2.5A peak).

[Learn More]

eFuse 4 click

0

eFuse 4 Click is a compact add-on board with a power path protection solution that limits circuit currents and voltages to safe levels during fault conditions. This board features the TPS25940, an eFuse power switch with reverse current blocking from Texas Instruments. The TPS25940 features a full suite of protection and monitoring functions, including a DevSleep™ mode that supports compliance with the SATA™ Device Sleep standard. The wide operating range from 2.7V to 18V allows control of many popular DC bus voltages. The additional potentiometer sets the overload and short-circuit current limit of the TPS25940, while the additional header allows external current monitoring.

[Learn More]