Difference between revisions of "Component: Current Sensor (ILA260) (Electrical)"

From Flowcode Help
Jump to navigationJump to search
(Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray...")
 
(No difference)

Latest revision as of 14:13, 22 October 2025

Author Matrix TSL
Version 1.0
Category Electrical


Current Sensor (ILA260) component

The INA260 provides voltage current and power monitoring via a digital I2C interface.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples







Macro reference

CheckAlert

Fc9-comp-macro.png CheckAlert
Checks to see if a conversion is ready or if a limit has been hit. Returns 1 for a conversion ready. 
Fc9-bool-icon.png - BOOL Return


Initialise

Fc9-comp-macro.png Initialise
Sets up the I2C ready for operation and initialises the sensor with the default settings. Returns 1 if the device is correctly identified. 
Fc9-bool-icon.png - BOOL Return


ReadCurrent

Fc9-comp-macro.png ReadCurrent
Reads the current as a floating point value in mA. 
Fc9-f32-icon.png - FLOAT Return


ReadPower

Fc9-comp-macro.png ReadPower
Reads the power as a floating point value in mW. 
Fc9-f32-icon.png - FLOAT Return


ReadVoltage

Fc9-comp-macro.png ReadVoltage
Reads the voltage as a floating point value in mV. 
Fc9-f32-icon.png - FLOAT Return


SetAlertLimit

Fc9-comp-macro.png SetAlertLimit
Sets the Alert limit in the format required. 
Fc9-f32-icon.png - FLOAT Limit
Limit in mA, mV or mW 
Fc9-u8-icon.png - BYTE Units
0=mA, 1=mV, 2=mW 
Fc9-void-icon.png - VOID Return


SetAveragingCount

Fc9-comp-macro.png SetAveragingCount
Sets the number of samples for each averaged sample. 
Fc9-u8-icon.png - BYTE Count
Range: 0-7 - 0=1, 1=4, 2=16, 3=64, 4=128, 5=256, 6=512, 7=1024 
Fc9-void-icon.png - VOID Return


SetConversionTime

Fc9-comp-macro.png SetConversionTime
Sets the amount of time required for each conversion. 
Fc9-u8-icon.png - BYTE Time
Range: 0-7 - 0=140uS, 1=204uS, 2=332uS, 3=588uS, 4=1.1mS, 5=2.116ms, 6=4.156mS, 7=8.244mS 
Fc9-void-icon.png - VOID Return


SetMaskedAlerts

Fc9-comp-macro.png SetMaskedAlerts
Sets the alert conditions that will be shown on the alert pin 
Fc9-u8-icon.png - BYTE AlertMask
0=None, bit0=ConversionReady, bit1=OverP, bit2=UnderV, bit3=OverV, bit4=UnderI, bit5=OverI 
Fc9-void-icon.png - VOID Return


SetMode

Fc9-comp-macro.png SetMode
Sets the mode of the sensor and therefore the amount of power consumed by the sensor. 
Fc9-u8-icon.png - BYTE Mode
0=Shutdown, 3=Triggered, 7=Continuous 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Connections
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-7-icon.png Stop Delay
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not a 10ms delay between an I2C stop event and the next I2C start event. Most modern microcontrollers will not have a problem so this property can be disabled to speed up the I2C communications.  
Fc9-type-16-icon.png Baud Select
Baud rate option selector 
Fc9-type-14-icon.png Baud Rate
Baud rate to be used 
Fc9-conn-icon.png Settings
Fc9-type-16-icon.png Address A0
 
Fc9-type-16-icon.png Address A1
 
Fc9-type-16-icon.png Default Mode
Sets the default mode of the sensor on initialise. Can be overridden using the SetMode macro. 
Fc9-type-16-icon.png Conversion Time
Sets the default conversion time set during initialise. Can be overridden using the SetConversionTime macro. 
Fc9-type-16-icon.png Averaging Count
Sets the number of samples used for each averaging period. Can be overridden using the SetAveragingCount macro. 
Fc9-type-16-icon.png Alert Polarity
 
Fc9-type-16-icon.png Alert Latch
 
Fc9-conn-icon.png Masked Alerts
Fc9-type-7-icon.png Conversion Ready
 
Fc9-type-16-icon.png Alert Limit
 
Fc9-type-15-icon.png Alert Value
 
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Scope Traces
Selects if the component pin connections are automatically generated on the data recorder window or not. Yes: Automatically add the component pins to a group on the data recorder which will reflect the sim data during simultion. No: Do not show the pin signals on the data recorder window. 
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-16-icon.png API
Specifies the API component on the panel to interact with to provide comms simulation. 

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Current_and_Power_Sensor_INA260.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Current_and_Power_Sensor_INA260.fcfx