Difference between revisions of "Component: Magnetometer (SM324) (Movement Orientation)"

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...")
 
Line 20: Line 20:
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 36: Line 38:
  
 
==Examples==
 
==Examples==
 +
 +
  
  
Line 53: Line 57:
  
  
==Downloadable macro reference==
+
==Macro reference==
  
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"

Revision as of 14:12, 20 January 2023

Author Matrix TSL
Version 1.0
Category Movement Orientation


Magnetometer (SM324) component

SM324 ultraprecise 24-bit smart magnetometer capable of distance measurement using a magnet. Controlled via I2C bus communications.

Component Source Code

Please click here for the component source code: FC_Comp_Source_Magnetometer_SM324.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Macro reference

Fc9-comp-macro.png ReadStatus
Reads the status byte from the sensor IC. Bit 6 = Voltage OK Bit 5 = Busy Bit 2 = Memory Error Bit 0 = Saturation 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png WriteMemory
Writes a 16-bit value to the specified memory location 
Fc9-u8-icon.png - BYTE Address
Internal memory address 
Fc9-u16-icon.png - UINT Value
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png RequestData
Requests temperature and magnetic data from the device, returns status. Bit 6 = Voltage OK Bit 5 = Busy Bit 2 = Memory Error Bit 0 = Saturation 
Fc9-u8-icon.png - BYTE Return


Fc9-comp-macro.png ReadTemperatureRaw
Reads the temperature from the last succesful data read. 
Fc9-s32-icon.png - LONG Return


Fc9-comp-macro.png ReadMagneticFieldRaw
Reads the magnetic field from the last succesful data read. 
Fc9-s32-icon.png - LONG Return


Fc9-comp-macro.png ReadMagneticFieldReal
Reads the magnetic field from the last succesful data read as a float in Oersted Oe. 
Fc9-s32-icon.png - LONG Return


Fc9-comp-macro.png SetAddress
Configures the device address used to communicate with sensor IC. Optionally writes the new address to the sensor IC NVM.  
Fc9-u8-icon.png - BYTE Address
The new address of the sensor IC, Range 8-127 
Fc9-bool-icon.png - BOOL WriteToIC
Writes the new address to the IC NVM 1=Write, 0=Don't Write 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png WriteCommand
Sends a command to the sensor IC. 
Fc9-u8-icon.png - BYTE Command
 
Fc9-void-icon.png - VOID Return


Fc9-comp-macro.png ReadTemperatureReal
Reads the temperature from the last succesful data read as an float in degrees C. 
Fc9-f32-icon.png - FLOAT Return


Fc9-comp-macro.png Initialise
Sets up the I2C bus ready to communicate with the sensor IC. Sets the address variable back to the Address property value. 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-conn-icon.png Sensor Properties
Fc9-type-16-icon.png Cyclic Mode
 
Fc9-conn-icon.png I2C Properties
Fc9-type-16-icon.png Channel
Channel selection 
Fc9-type-21-icon.png Address
Address of the SM324 IC, Default address is 16. Valid Address range = 8 to 127 
Fc9-type-5-icon.png SDA
Pin used for SDA (data signal) 
Fc9-type-16-icon.png SDA Remap Pin
 
Fc9-type-5-icon.png SCL
Pin used for SCL (clock signal) 
Fc9-type-16-icon.png SCL Remap Pin
 
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 Threshold Output
Fc9-type-5-icon.png Threshold Pin
The pins used to check the DOUT pin on the SM324, 
Fc9-type-16-icon.png Threshold Setting
Controls the function of the sensor IC DOUT pin. 
Fc9-type-14-icon.png Threshold1
Threshold 1 Value 
Fc9-type-14-icon.png Threshold2
Threshold 2 value. If Thresh1 > Thresh2 1: Measurement > Thresh1 OR Measurement < Thresh2 0: Thresh1 > Measurement > Thresh2 If Thresh2 > Thresh1 1: Thresh1 > Measurement > Thresh2 0: Measurement > Thresh2 OR Measurement < Thresh1  
Fc9-conn-icon.png Simulation
Fc9-type-7-icon.png Simulate Comms