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 to download the component source project: FC_Comp_Source_Magnetometer_SM324.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Magnetometer_SM324.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
|
ReadStatus
|
Reads the status byte from the sensor IC. Bit 6 = Voltage OK Bit 5 = Busy Bit 2 = Memory Error Bit 0 = Saturation
|
- BYTE
|
Return
|
|
WriteMemory
|
Writes a 16-bit value to the specified memory location
|
- BYTE
|
Address
|
Internal memory address
|
- UINT
|
Value
|
|
- VOID
|
Return
|
|
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
|
- BYTE
|
Return
|
|
ReadTemperatureRaw
|
Reads the temperature from the last succesful data read.
|
- LONG
|
Return
|
|
ReadMagneticFieldRaw
|
Reads the magnetic field from the last succesful data read.
|
- LONG
|
Return
|
|
ReadMagneticFieldReal
|
Reads the magnetic field from the last succesful data read as a float in Oersted Oe.
|
- LONG
|
Return
|
|
SetAddress
|
Configures the device address used to communicate with sensor IC. Optionally writes the new address to the sensor IC NVM.
|
- BYTE
|
Address
|
The new address of the sensor IC, Range 8-127
|
- BOOL
|
WriteToIC
|
Writes the new address to the IC NVM 1=Write, 0=Don't Write
|
- VOID
|
Return
|
|
WriteCommand
|
Sends a command to the sensor IC.
|
- BYTE
|
Command
|
|
- VOID
|
Return
|
|
ReadTemperatureReal
|
Reads the temperature from the last succesful data read as an float in degrees C.
|
- FLOAT
|
Return
|
|
Initialise
|
Sets up the I2C bus ready to communicate with the sensor IC. Sets the address variable back to the Address property value.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Sensor Properties
|
|
Cyclic Mode
|
|
|
I2C Properties
|
|
Channel
|
Channel selection
|
|
Address
|
Address of the SM324 IC, Default address is 16. Valid Address range = 8 to 127
|
|
SDA
|
Pin used for SDA (data signal)
|
|
SDA Remap Pin
|
|
|
SCL
|
Pin used for SCL (clock signal)
|
|
SCL Remap Pin
|
|
|
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.
|
|
Baud Select
|
Baud rate option selector
|
|
Baud Rate
|
Baud rate to be used
|
|
Threshold Output
|
|
Threshold Pin
|
The pins used to check the DOUT pin on the SM324,
|
|
Threshold Setting
|
Controls the function of the sensor IC DOUT pin.
|
|
Threshold1
|
Threshold 1 Value
|
|
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
|
|
Simulation
|
|
Simulate Comms
|
|
==Macro reference==
|
ReadStatus
|
Reads the status byte from the sensor IC. Bit 6 = Voltage OK Bit 5 = Busy Bit 2 = Memory Error Bit 0 = Saturation
|
- BYTE
|
Return
|
|
WriteMemory
|
Writes a 16-bit value to the specified memory location
|
- BYTE
|
Address
|
Internal memory address
|
- UINT
|
Value
|
|
- VOID
|
Return
|
|
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
|
- BYTE
|
Return
|
|
ReadTemperatureRaw
|
Reads the temperature from the last succesful data read.
|
- LONG
|
Return
|
|
ReadMagneticFieldRaw
|
Reads the magnetic field from the last succesful data read.
|
- LONG
|
Return
|
|
ReadMagneticFieldReal
|
Reads the magnetic field from the last succesful data read as a float in Oersted Oe.
|
- LONG
|
Return
|
|
SetAddress
|
Configures the device address used to communicate with sensor IC. Optionally writes the new address to the sensor IC NVM.
|
- BYTE
|
Address
|
The new address of the sensor IC, Range 8-127
|
- BOOL
|
WriteToIC
|
Writes the new address to the IC NVM 1=Write, 0=Don't Write
|
- VOID
|
Return
|
|
WriteCommand
|
Sends a command to the sensor IC.
|
- BYTE
|
Command
|
|
- VOID
|
Return
|
|
ReadTemperatureReal
|
Reads the temperature from the last succesful data read as an float in degrees C.
|
- FLOAT
|
Return
|
|
Initialise
|
Sets up the I2C bus ready to communicate with the sensor IC. Sets the address variable back to the Address property value.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Sensor Properties
|
|
Cyclic Mode
|
|
|
I2C Properties
|
|
Channel
|
Channel selection
|
|
Address
|
Address of the SM324 IC, Default address is 16. Valid Address range = 8 to 127
|
|
SDA
|
Pin used for SDA (data signal)
|
|
SDA Remap Pin
|
|
|
SCL
|
Pin used for SCL (clock signal)
|
|
SCL Remap Pin
|
|
|
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.
|
|
Baud Select
|
Baud rate option selector
|
|
Baud Rate
|
Baud rate to be used
|
|
Threshold Output
|
|
Threshold Pin
|
The pins used to check the DOUT pin on the SM324,
|
|
Threshold Setting
|
Controls the function of the sensor IC DOUT pin.
|
|
Threshold1
|
Threshold 1 Value
|
|
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
|
|
Simulation
|
|
Simulate Comms
|
|
==Macro reference==
|
ReadStatus
|
Reads the status byte from the sensor IC. Bit 6 = Voltage OK Bit 5 = Busy Bit 2 = Memory Error Bit 0 = Saturation
|
- BYTE
|
Return
|
|
WriteMemory
|
Writes a 16-bit value to the specified memory location
|
- BYTE
|
Address
|
Internal memory address
|
- UINT
|
Value
|
|
- VOID
|
Return
|
|
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
|
- BYTE
|
Return
|
|
ReadTemperatureRaw
|
Reads the temperature from the last succesful data read.
|
- LONG
|
Return
|
|
ReadMagneticFieldRaw
|
Reads the magnetic field from the last succesful data read.
|
- LONG
|
Return
|
|
ReadMagneticFieldReal
|
Reads the magnetic field from the last succesful data read as a float in Oersted Oe.
|
- LONG
|
Return
|
|
SetAddress
|
Configures the device address used to communicate with sensor IC. Optionally writes the new address to the sensor IC NVM.
|
- BYTE
|
Address
|
The new address of the sensor IC, Range 8-127
|
- BOOL
|
WriteToIC
|
Writes the new address to the IC NVM 1=Write, 0=Don't Write
|
- VOID
|
Return
|
|
WriteCommand
|
Sends a command to the sensor IC.
|
- BYTE
|
Command
|
|
- VOID
|
Return
|
|
ReadTemperatureReal
|
Reads the temperature from the last succesful data read as an float in degrees C.
|
- FLOAT
|
Return
|
|
Initialise
|
Sets up the I2C bus ready to communicate with the sensor IC. Sets the address variable back to the Address property value.
|
- VOID
|
Return
|
Property reference
|
Properties
|
|
Sensor Properties
|
|
Cyclic Mode
|
|
|
I2C Properties
|
|
Channel
|
Channel selection
|
|
Address
|
Address of the SM324 IC, Default address is 16. Valid Address range = 8 to 127
|
|
SDA
|
Pin used for SDA (data signal)
|
|
SDA Remap Pin
|
|
|
SCL
|
Pin used for SCL (clock signal)
|
|
SCL Remap Pin
|
|
|
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.
|
|
Baud Select
|
Baud rate option selector
|
|
Baud Rate
|
Baud rate to be used
|
|
Threshold Output
|
|
Threshold Pin
|
The pins used to check the DOUT pin on the SM324,
|
|
Threshold Setting
|
Controls the function of the sensor IC DOUT pin.
|
|
Threshold1
|
Threshold 1 Value
|
|
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
|
|
Simulation
|
|
Simulate Comms
|
|