M3021-000005-500PG TE-CONNECTIVITY | Alldatasheet
Document overview
- Manufacturer or author: Provided By alldatasheet.com(free datasheet download site)
- PDF pages: 20
Technical content
SENSOR SOLUTIONS ///MSP300 Page 1 04/2020
FEATURES
APPLICATIONS
One Piece Stainless Steel Construction Ranges up to 15kpsi Digital Pressure and Temperature Output or Analog mV/Amplified Output ±1 %Span Accuracy UL Certification (analog only) Pumps and Compressors Hydraulic/Pneumatic Systems Automotive Test Systems Energy and Water Management Medical Gas Pressure Leak Detection Remote Measuring Systems General Pressure Measurements MSP300 Pressure Transducer SPECIFICATIONS Analog Output or 14-Bit Digital Pressure with 11-Bit Temperature Output One Piece Stainless Steel Construction Low Cost 17-4PH or 316L Stainless Steel Customizable The MSP300 pressure transducer from the Microfused line of TE is suitable for measurement of liquid or gas pressure, even for difficult media such as contaminated water, steam, and mildly corrosive fluids. The transducer pressure cavity is machined from a solid piece of 17-4PH or 316L stainless steel. The standard version includes a 1/4 NPT pipe thread allowing a leak-proof, all metal sealed system. With excellent durability, there are no welds or organics exposed to the pressure media. TE’s proprietary Microfused technology, derived from demanding aerospace applications, employs micromachined silicon piezoresistive strain gages fused with high temperature glass to a stainless steel diaphragm. This approach achieves media compatibility simply and elegantly while providing an exceptionally stable sensor without the PN junctions of conventional micromachined sensors. This product is geared towards industrial and commercial OEMs for small to high volume applications. Standard configurations are suitable for many applications. Please contact factory for your customization needs.
SENSOR SOLUTIONS ///MSP300 10/2021 Page 2 STANDARD RANGES Range (psi) Range (Bar) Gage/Compound 0 to 100 0 to 007 0 to 200 0 to 010 0 to 300 0 to 020 0 to 500 0 to 035 0 to 01k 0 to 070 0 to 03k 0 to 200 0 to 05k 0 to 350 0 to 10k 0 to 700 0 to 15k 0 to 01k ALL INTERMEDIATE RANGES ARE STANDARD PERFORMANCE SPECIFICATIONS (ANALOG) Supply Voltage: 5.0V, Ambient Temperature: 25°C (unless otherwise specified) PARAMETERS MIN TYP MAX UNITS NOTES Pressure Accuracy (RSS combined Non Linearity, Hysteresis & Repeatability) -1 1 %Span BFSL @ 25°C Pressure Cycles 1.00E+6 0~F.S. Cycles Proof Pressure 2X Rated Burst Pressure 5X 20000PSI Rated Whichever is less Isolation, Body to Any Lead 50 MΩ @ 250VDC Long Term Stability (1 year) -0.25 0.25 %Span Zero Thermal Error -2.0 2.0 %Span Over comp. temp Span Thermal Error -2.0 2.0 %Span Over comp. temp Zero Offset (mV Output) -3.0 3.0 %Span @ 25°C Zero Offset (V Output) -2.0 2.0 %Span @ 25°C Span Tolerance -2.0 2.0 %Span @ 25°C Compensated Temperature 0 55 °C Operating Temperature -20 +85 °C Storage Temperature -40 +85 °C Load Resistance (RL, mV Output) 1 MΩ Load Resistance (RL, V Output) 5 KΩ Response Time 1 ms Shock 50g, 11 msec Half Sine Shock per MIL-STD-202G, Method 213B, Condition A Vibration ±20g, MIL-STD-810C, Procedure 514.2-2, Curve L Wetted Material (except elastomer seal) 17-4PH or 316L Stainless Steel For custom configurations, consult factory.
SENSOR SOLUTIONS ///MSP300 10/2021 Page 3 PERFORMANCE SPECIFICATIONS (DIGITAL) Supply Voltage: 3.3V, Ambient Temperature: 25°C (unless otherwise specified) PARAMETERS MIN TYP MAX UNITS NOTES Supply Voltage 2.7 5.0 VDC Output at Zero Pressure 720 1000 1280 Count Output at FS Pressure 14720 15000 15280 Count Current Consumption 3.5 mA Current Consumption (Sleep mode) 5 uA Proof Pressure 2X Rated Burst Pressure 5X 20000PSI Rated Whichever is less Isolation, Body to Any Lead 50 MΩ @ 250VDC Pressure Cycles 1.00E+6 0~F.S. Cycles Pressure Accuracy (RSS combined Non Linearity, Hysteresis & Repeatability) -1 1 %Span BFSL @ 25°C Temperature Accuracy -3 3 °C 1 Zero Thermal Error -2.0 2.0 %Span Over comp. temp Span Thermal Error -2.0 2.0 %Span Over comp. temp Long Term Stability (1 year) -0.25 0.25 %Span @ 25°C Compensated Temperature 0 55 °C Compensated Temperature Output 512 1075 Count Response time 3 ms @ 4MHz Non-sleep mode, 2 Response time 8.4 ms @ 4MHz Sleep mode, 2 Operating Temperature -20 +85 °C Storage Temperature -40 +85 °C Shock 50g, 11 msec Half Sine Shock per MIL-STD-202G, Method 213B, Condition A Vibration ±20g, MIL-STD-810C, Procedure 514.2-2, Curve L Wetted Material (except elastomer seal) 17-4PH or 316L Stainless Steel For custom configurations, consult factory. Notes 1. Reflect pressure port diaphragm temperature over the c ompensated temperature range. 2. Response time is from power on to reading measuremen t data.
SENSOR SOLUTIONS ///MSP300 10/2021 Page 4 DIMENSIONS NOTE: FOR PRESSURE PORT CODE ‘W’, TYPICAL HEX DIMENSION WILL BE 1.260[32.00] OUTPUT (ANALOG) Code Output Supply Ratiometricity Red Black Green White 1 0 – 50mV 5V Yes +Supply -Supply +Output -Output 2 0 – 100mV 5V Yes +Supply -Supply +Output -Output 3 0.5 – 4.5V 5 ± 0.25V Yes +Supply Common Cut Off +Output 4 1 – 5V 10 – 30V No +Supply Common Cut Off +Output 5 4 – 20mA 9 – 30V No +Supply -Supply Cut Off Cut Off OUTPUT (DIGITAL) Code Output Supply Red Black Green White Yellow J I2C 2.7 – 5.0V +Supply -Supply SCL SDA -- S SPI 2.7 – 5.0V +Supply -Supply SCLK MISO SS CODE PORT DIM C 2 1/4-19 BSPP 0.453[11.50] 4 7/16-20 UNF-A MALE SAE J514 STRAIGHT THREAD O- RING BUNA-N 70SH-904, ID8.92mm x W1.83mm 0.435[11.05] 5 1/4-18 NPT 0.596[15.14] 6 1/8-27 NPT 0.475[12.06] E 1/4-19 BSPT 0.50[12.70] F 1/4-19 BSPP FEMALE 0.70[17.78] K 1/8-27 NPT FEMALE 0.70[17.78] P 7/16-20 UNF-2A FEMALE SAE J514 STRAIGHT THREAD WITH INTEGRAL VALVE DEPRESSOR 0.689[17.50] Q M10 x 1.0 mm 0.42[10.67] S M12 x 1.5 mm 0.53[13.46] U G/14 DIN 3852 FORM E GASKET DIN3869-14 NBR 0.519[13.18] W M20 x 1.5 mm 0.702[17.83] CODE CONNECTION TYPE
1 CABLE 2 FT
2 CABLE 4 FT
3 CABLE 10 FT
(ANALOG ONLY) R CABLE 10 M (ANALOG ONLY)
SENSOR SOLUTIONS ///MSP300 10/2021 Page 5 PRESSURE OUTPUT
SENSOR SOLUTIONS ///MSP300 10/2021 Page 6 TEMPERATURE OUTPUT
SENSOR SOLUTIONS ///MSP300 10/2021 Page 7
ORDERING INFORMATION
M30 3 3 – 1 0 0 0 0 K – 350B G Output Code Output Signal Supply Voltage 1 0-50mV 5V 2 0-100mV 5V 3 0.5-4.5V 5±0.25V 4 1-5V 10-30V 5 4-20mA 9-30V J* I2C 2.7-5.0V S* SPI 2.7-5.0V Pressure Reference G Gauge C Compound Pressure Ranges Psi Std Bar Std 100P 007B 200P 010B 300P 020B 500P 035B 01KP 070B 03KP 200B 05KP 350B 10KP 700B 15KP 01KB Cable Length 1 2 feet 2 4 feet 3 10 feet M 1 meter N 2 meter P 5 meter (Analog only) R 10 meter (Analog only) Pressure Port Code Port Type Dim C 2 1/4-19 BSPP 0.453[11.50] 7/16-20 UNF-2A Male SAE J514 Straight Thread O-Ring Boss O-Ring BUNA-N 70SH-904 ID8.92mm X W1.83mm 0.435[11.05] 5 1/4-18 NPT 0.596[15.14] 6 1/8-27 NPT 0.475[12.06] E 1/4-19 BSPT 0.50[12.70] F 1/4-19 BSPP Female 0.70[17.78] K 1/8-27 NPT Female 0.70[17.78] P 7/16-20 UNF-2A Female SAE J514 Straight Thread w/ Integral Valve Depressor 0.689[17.50] Q M10x1.0mm 0.420[10.67] S M12x1.5mm 0.53[13.90] U G1/4 DIN 3852 Form E Gasket DIN3869-14 NBR 0.547[13.90] W M20 x 1.5mm 0.702[17.83] Port Material 0 17-4PH Stainless Steel 1 316L Stainless Steel Cleaning
0 No Selection
1 Oxygen Clean B40.1, Level IV Sleep (Digital Only)
0 Non-sleep Mode
1 Sleep Mode
Code Address for I2C (Digital Only) 0 0X28H 1 0x36H 2 0x46H 3 0x48H 4 0x51H All Intermediate Ranges are Standard *Digital Options SPI Default Code ‘0’
SENSOR SOLUTIONS ///MSP300 10/2021 Page 8 OLD ORDERING INFORMATION MSP-300-100 – P – 5 – P – 1 Pressure Ranges Psi Std Bar Std 100 007 200 010 300 020 500 035 01K 070 03K 200 05K 350 10K 700 15K 01K Cable Length 1 2 feet 2 4 feet 3 10 feet M 1 meter N 2 meter P 5 meter R 10 meter Code Port Type B 1/4-19 BSPP D 7/16-20 UNF-2A Male SAE J514 Straight Thread O-Ring Boss O-Ring BUNA-N 70SH-904 ID8.92mm X W1.83mm N 1/4-18 NPT A 1/8-27 NPT E 1/4-19 BSPT F 1/4-19 BSPP Female H 1/8-27 NPT Female P 7/16-20 UNF-2A Female SAE J514 Straight Thread w/ Integral Valve Depressor Q M10x1.0mm S M12x1.5mm C G1/4 DIN 3852 Form E Gasket DIN3869-14 NBR W M20 x 1.5mm Pressure Unit P Psi B Bar Output Code Output Signal Supply Voltage 1 0-50mV 5V 2 0-100mV 5V 3 0.5-4.5V 5±0.25V 4 1-5V 10-30V 5 4-20mA 9-30V TE.com/sensorsolutions Measurement Specialties, Inc., a TE Connectivity company. Measurement Specialties, TE Connectivity, TE Connectivity (logo) and EVERY CONNECTION COUNTS are trademarks. All other logos, products and/or company names referred to herein might be trademarks of their respective owners. The information given herein, including drawings, illustrations and schematics which are intended for illustration purposes only, is believe d to be reliable. However, TE Connectivity makes no warranties as to its accuracy or completeness and disclaims any liability in connection with its use. TE Connectivity‘s obligati ons shall only be as set forth in TE Connectivity‘s Standard Terms and Conditions of Sale for this product and in no case will TE Connectivity be liable for any incidental, indirect or consequential damages arising out of the sale, resale, use or misuse of the product. Users of TE Connectivity products should make their own evaluation to determine the suitability of each such product for the specific application. © 2015 TE Connectivity Ltd. family of companies All Rights Reserved. NORTH AMERICA Measurement Specialties, Inc., a TE Connectivity Company Phone: 800-522-6752 Email: customercare.frmt@te.com EUROPE Measurement Specialties (Europe), Ltd., a TE Connectivity Company Phone: +31 73 624 6999 Email: customercare.lcsb@te.com ASIA Measurement Specialties (China), Ltd., a TE Connectivity Company Phone: 0400-820-6015 Email: customercare.shzn@te.com All Intermediate Ranges are Standard
SENSOR SOLUTIONS ///MSP300 10/2021 Page 9 INTERFACING TO TE DIGITAL PRESSURE MODULES The TE series of digital pressure sensors uses the latest CMOS sensor conditioning circuitry (SSC) to create a low cost, high performance digital output pressure (14-bit) and temperature (11-bit) sensor designed to meet the strictest requirements from OEM customers. The MS45x5DO, 85BSD, 85FBSD, 86BSD,154BSD, MSP100(DO) and MSP300(DO) , M3200(DO), FX29(DO) and FS30(DO)are the latest offering from TE to offer digital communication to pressure sensor OEMs. I2C AND SPI INTERFACE SPECIFICATIONS 1. I2C Interface Specification The I2C interface is a simple 8-bit protocol using a serial data line (SDA) and a serial clock line (SCL) where each device connected to the bus is software addressable by a unique address. For detailed specifications of the I2C protocol, see The I2C Bus Specification, Version 2.1, January 2000. ϭ.ϭ IŶteƌface CoŶŶectioŶ-ExteƌŶal Bi-directional bus lines are implemented by the devices (master and slave) using open-drain output stages and a pull-up resistor connected to the positive supply voltage. The recommended pull-up resistor value depends on the system setup (capacitance of the circuit or cable and bus clock frequency). In most cases, 4.7kΩ is a reasonable choice. The capacitive loads on SDA and SCL line have to be the same. It is important to avoid asymmetric capacitive loads. ϭ.Ϯ IϮC Addƌess The I2C address consists of a 7-digit binary value. The factory setting for the I2C slave address is 0x28, 0x36 or 0x46 depending on the interface type selected from the ordering information. The address is always followed by a write bit (0) or read bit (1). The default hexadecimal I2C header for read access to the sensor is therefore 0x51, 0x6D, 0x8D respectively, based on the ordering information.
SENSOR SOLUTIONS ///MSP300 10/2021 Page 10 ϭ.ϯ INT/SS PiŶ When programmed as an I2C device, the INT/SS pin operates as an interrupt. The INT/SS pin rises when new output data is ready and falls when the next I2C communication occurs. ϭ.ϰ TƌaŶsfeƌ SeƋueŶces Transmission START Condition (S): The START condition is a unique situation on the bus created by the master, indicating to the slaves the beginning of a transmission sequence (the bus is considered busy after a START). Transmission STOP Condition (P): The STOP condition is a unique situation on the bus created by the master, indicating to the slaves the end of a transmission sequence (the bus is considered free after a STOP). Acknowledge (ACK) / Not Acknowledge (NACK): Each byte (8 bits) transmitted over the I2C bus is followed by an acknowledge condition from the receiver. This means that after the master pulls SCL low to complete the transmission of the 8th bit, SDA will be pulled low by the receiver during the 9th bit time. If after transmission of the 8th bit the receiver does not pull the SDA line low, this is considered to be a NACK condition. If an ACK is missing during a slave to master transmission, the slave aborts the transmission and goes into idle mode. I C Transmission Start Condition A HIGH to LOW transition on the SDA line while SCL is HIGH SDA SCL START condition I C Transmission Stop Condition A LOW to HIGH transition on the SDA line while SCL is HIGH STOP condition SDA SCL
SENSOR SOLUTIONS ///MSP300 10/2021 Page 11 I2 C ACKNOWLEDGE / NOT ACKNOWLEDGE Each byte is followed by an acknowledge or a not acknowledge, generated by the receiver
1.5 Data Transfer Format
Data is transferred in byte packets in the I2C protocol, which means in 8-bit frames. Each byte is followed by an acknowledge bit. Data is transferred with the most significant bit (MSB) first. A data transfer sequence is initiated by the master generating the Start condition (S) and sending a header byte. The I2C header consists of the 7-bit I2C device address and the data direction bit (R/_W). The value of the R/_W bit in the header determines the data direction for the rest of the data transfer sequence. If R/_W = 0 (WRITE), the direction remains master-to-slave, while if R/_W = 1 (READ), the direction changes to slave-to-master after the header byte.
1.6 Command Set and Data Transfer Sequences
The I2C master command starts with the 7-bit slave address with the 8th bit = 1 (READ). The sensor acts as the slave and sends an acknowledge (ACK) indicating success. The sensor has four I2C read commands: Read_MR, Read_DF2, Read_DF3, and Read_DF4.Figure 1.6 shows the structure of the measurement packet of the four I2C read commands, which are explained in sections 1.6.1.
SENSOR SOLUTIONS ///MSP300 10/2021 Page 12 ϭ.6.ϭ Figuƌe ϭ.6 – IϮC MeasuƌeŵeŶt Packet ReadsIϮC Read_DF ;Data FetchͿ For Data Fetch commands, the number of data bytes returned by the sensor, is determined when the master sends the NACK and stop condition. For the Read_DF3 data fetch command (Data Fetch 3 Bytes; see example 3 in Figure 1.6), the sensor returns three bytes in response to the master sending the slave address and the READ bit (1): two bytes of bridge data with the two status bits as the MSBs and then 1 byte of temperature data (8-bit accuracy). After receiving the required number of data bytes, the master sends the NACK and stop condition to terminate the read operation. For the Read_DF4 command, the master delays sending the NACK and continues reading an additional final byte to acquire the full corrected 11-bit temperature measurement. In this case, the last 5 bits of the final byte of the packet are undetermined and should be masked off in the application. The Read_DF2 command is used if corrected temperature is not required. The master terminates the READ operation after the two bytes of bridge data (see example 2 in Figure 1.6). The two status bits (Bit 15 and Bit 14) give an indication of stale or valid data depending on their value. A returned value of 00 indicate “normal operation and a good data packet” while a returned value of 10 indicates “stale data that has been already fetched”. See section 1.7 for additional details. Users that use “status bit” polling should select a frequency slower than 20% more than the update time.
1.7 Status Bits and Diagnostic Features
The table below summarizes the status bits conditions indicated by the 2 MSBs (Bit (15:14) of I2C data packet, S(1:0) of SPI data packet of the bridge high byte data.
SENSOR SOLUTIONS ///MSP300 10/2021 Page 13 Table 1: Status Bits Encoding Status Bits (2 MSB of Output Data Packet) Definition 00 Normal Operation. Good Data Packet
01 Reserved
10 Stale Data. Data has been fetched since last measurement cycle.
11 Fault Detected
The SSC is has on board diagnostic features to ensure robust system operation in the most “mission-critical” applications. A status bit value of “11” indicates a fault condition in the SSC or sensing element. All diagnostics are detected in the next measurement cycle and reported in the subsequent data fetch. Once a diagnostic is reported, the diagnostic status bits will not change unless both the cause of the diagnostic is fixed and a power-on-reset is performed.
1.8 I2C Protocol Differences
There are three differences in the described above protocol compared with original I2C protocol: Sending a start-stop condition without any transitions on the SCL line (no clock pulses in between) creates a commu nication error for the next communication, even if the next start condition is correct and the clock pulse is applied. An additional start condition must be sent, which results in restoration of proper communication. The restart condition – a falling SDA edge during data trans mission when the SCL clock line is still hi gh – creates the same situation. The next communication fails, and an additional start condition must be sent for correct communication. A falling SDA edge is not allowed between the start condit ion and the first rising SCL edge. If using an I 2C address with the first bit 0, SDA must be held down from the start condition through the first bit. 2. SPI Interface Specification SPI is a general-purpose synchronous serial interface. During an SPI transfer, transmit and receive data is simultaneously shifted out and in serially. A serial clock line synchronizes the shifting and sampling of the information on two serial data lines. SPI devices communicate using a master-slave relationship. Due to its lack of built-in device addressing, SPI requires more effort and more hardware resources than I2C when more than one slave is involved. But SPI tends to be simpler and more efficient than I2C in point-to-point (single master, single slave) applications for the very same reason; the lack of device addressing means less overhead. The SPI interface is programmed for falling-edge MISO change.
SENSOR SOLUTIONS ///MSP300 10/2021 Page 14 Ϯ.ϭ SPI Read_DF ;Data FetchͿ The SPI interface will have data change after the falling edge of SCLK. The master should sample MISO on the rise of SCLK. The entire output packet is 4 bytes (32 bits). The high bridge data byte comes first, followed by the low bridge data byte. Then 11 bits of corrected temperature (T[10:0]) are sent: first the T[10:3]byte and then the {T[2:0],xxxxx} byte. The last 5 bits of the final byte are undetermined and should be masked off in the application. If the user only requires the corrected bridge value, the read can be terminated after the 2nd byte. If the corrected temperature is also required but only at an 8-bit resolution, the read can be terminated after the 3rd byte is read. Packet = [ {S(1:0),B(13:8)},{B(7:0)},{T(10:3)},{T(2:0),xxxxx}] Where S(1:0) = Status bits of packet (normal, command, busy, diagnostic) B(13:8) = Upper 6 bits of 14-bit bridge data. B(7:0) = Lower 8 bits of 14-bit bridge data. T(10:3) = Corrected temperature data (if application does not require corrected temperature, terminate read early) T(2:0),xxxxx =. Remaining bits of corrected temperature data for full 11-bit resolution HiZ = High impedance Figure 2.2 – SPI Output Packet with Falling Edge SPI_Polarity TIMING DIAGRAMS I2C INTERFACE PARAMETERS PARAMETERS SYMBOL MIN TYP MAX UNITS SCLK CLOCK FREQUENCY fSCL 100 400 KHz START CONDITION HOLD TIME RELATIVE TO SCL EDGE tHDSTA 0.1 uS MINIMUM SCL CLOCK LOW WIDTH 1 tLOW 0.6 uS MINIMUM SCL CLOCK HIGH WIDTH 1 tHIGH 0.6 uS START CONDITION SETUP TIME RELATIVE TO SCL EDGE tSUSTA 0.1 uS DATA HOLD TIME ON SDA RELATIVE TO SCL EDGE tHDDAT 0 uS DATA SETUP TIME ON SDA RELATIVE TO SCL EDGE tSUDAT 0.1 uS STOP CONDITION SETUP TIME ON SCL tSUSTO 0.1 uS BUS FREE TIME BETWEEN STOP AND START CONDITION tBUS 2 uS 1COMBINED LOW AND HIGH WIDTHS MUST EQUAL OR EXCEED MINIMUM SCL PERIOD.
SENSOR SOLUTIONS ///MSP300 10/2021 Page 15 IϮC TiŵiŶg Diagƌaŵ PARAMETERS SYMBOL MIN TYP MAX UNITS SCLK CLOCK FREQUENCY fSCL 50 800 KHz SS DROP TO FIRST CLOCK EDGE tHDSS 2.5 uS MINIMUM SCL CLOCK LOW WIDTH 1 tLOW 0.6 uS MINIMUM SCL CLOCK HIGH WIDTH 1 tHIGH 0.6 uS CLOCK EDGE TO DATA TRANSITION tCLKD 0 0.1 uS RISE OF SS RELATIVE TO LAST CLOCK EDGE tSUSS 0.1 uS BUS FREE TIME BETWEEN RISE AND FALL OF SS tBUS 2 uS 1 COMBINED LOW AND HIGH WIDTHS MUST EQUAL OR EXCEED MINIMUM SCLK PERIOD. C Code Example For FX29
SENSOR SOLUTIONS ///MSP300 10/2021 Page 16 //Note: The C code is use for communication with FX29K0-040B-0100-L using STM32L031. // This routine is applicable to other models mentioned in this document. #include "main.h" #include "stm32l0xx_hal.h" #include "stdlib.h" #include "delay.h" #include "config.h" u8 temp[7]; float Tscope,Pscope,Tdisplay,Pdisplay; float Lmax=100,Lmin=0;//Span 100L,Zero 0L, Span should be defined by the sensor pressure range of customer used. 100 means pressure range of 100L u32 Pvalue,Tvalue,Tspan,Pspan; u16 P1=1000,P2=15000; void SDA_IN2(void); void SDA_OUT2(void); void IIC_Start2(void); void IIC_Stop2(void); unsigned char IIC_Wait_Ack2(void); void IIC_Ack2(void); void IIC_NAck2(void); void IIC_Send_Byte(unsigned char txd); unsigned char IIC_Read_Byte(unsigned char ack); float Get_I2CValue(void); void SDA_IN2() GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.Pin = SDA2_Pin; GPIO_InitStructure.Mode = GPIO_MODE_INPUT; GPIO_InitStructure.Pull = GPIO_NOPULL; //GPIO_InitStructure.Alternate = GPIO_PuPd_UP; GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(SDA2_GPIO_Port, &GPIO_InitStructure); void SDA_OUT2() GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitStructure.Pin = SDA2_Pin;
SENSOR SOLUTIONS ///MSP300 10/2021 Page 17 GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP; GPIO_InitStructure.Pull = GPIO_NOPULL; GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(SDA2_GPIO_Port, &GPIO_InitStructure); void IIC_Start2() SDA_OUT2(); //sda??? Sensor_SDA_ON ; Sensor_SCL_ON; delay_us(4); Sensor_SDA_OFF;//START:when CLK is high,DATA change form high to low delay_us(4); void IIC_Stop2() SDA_OUT2();//sda ??? Sensor_SCL_OFF; Sensor_SDA_OFF;//STOP:when CLK is high DATA change form low to high delay_us(4); Sensor_SCL_ON; delay_us(4); unsigned char IIC_Wait_Ack2() unsigned char ucErrTime=0; Sensor_SDA_ON ;delay_us(1); Sensor_SCL_ON;delay_us(1); while(READ_Sensor_SDA) ucErrTime++; if(ucErrTime>250) IIC_Stop2(); return 1;
SENSOR SOLUTIONS ///MSP300 10/2021 Page 18 return 0; void IIC_Ack2() Sensor_SCL_OFF; SDA_OUT2(); Sensor_SDA_OFF; delay_us(2); Sensor_SCL_ON; delay_us(2); Sensor_SCL_OFF; void IIC_NAck2() Sensor_SCL_OFF; SDA_OUT2(); Sensor_SDA_ON; delay_us(2); Sensor_SCL_ON; delay_us(2); Sensor_SCL_OFF; void IIC_Send_Byte(unsigned char txd) unsigned char t; SDA_OUT2(); for(t=0;t<8;t++) if(txd&0x80) {Sensor_SDA_ON;} else {Sensor_SDA_OFF;} txd<<=1; Sensor_SCL_ON; delay_us(2); Sensor_SCL_OFF; delay_us(2);
SENSOR SOLUTIONS ///MSP300 10/2021 Page 19 unsigned char IIC_Read_Byte(unsigned char ack) unsigned char i,receive=0; for(i=0;i<8;i++ ) Sensor_SCL_OFF; delay_us(2); Sensor_SCL_ON; receive<<=1; if(READ_Sensor_SDA)receive++; delay_us(1); if (!ack) IIC_NAck2();//??nACK else IIC_Ack2(); //??ACK return receive; u8 I2C_ERR=0; float Get_I2CValue() //Wake_up ,if non-sleep mode this part is no needed. IIC_Start2(); //MR command IIC_Send_Byte(0x51); IIC_Wait_Ack2(); IIC_Stop2(); HAL_Delay(2); //2ms delay IIC_Start2(); //DF4 IIC_Send_Byte(0x51); IIC_Wait_Ack2(); temp[0]=IIC_Read_Byte(1); temp[1]=IIC_Read_Byte(1); temp[2]=IIC_Read_Byte(1); temp[3]=IIC_Read_Byte(0);
SENSOR SOLUTIONS ///MSP300 10/2021 Page 20 IIC_Stop2(); if((temp[0]&0xc0)==0x00) Pvalue=(temp[0]<<8) | temp[1]; Tvalue=(temp[2]<<3) | (temp[3]>>5); I2C_ERR=0; else I2C_ERR=1; Tscope=200;//-50~150 Tspan=2048;//11bit if(I2C_ERR==0) Pspan=P2-P1; Tdisplay=Tvalue*Tscope/Tspan-50; Pdisplay=Pvalue*(Lmax-Lmin)/Pspan+Lmin;//100L return Pdisplay; NORTH AMERICA EUROPE ASIA Measurement Specialties, Inc., a TE Connectivity company 45738 Northport Loop West Fremont, CA 94538 Tel: +1 800 767 1888 Fax: +1 510 498 1578 customercare.frmt@te.com MEAS Switzerland Sarl, a TE Connectivity company Ch. Chapons-des-Prés 11 CH-
2022 Bevaix
Tel: +41 32 847 9550 Fax: +41 32 847 9569 customercare.bevx@te.com Measurement Specialties (China) Ltd., a TE Connectivity company No. 26 Langshan Road Shenzhen High-Tech Park (North) Nanshan District, Shenzhen, 518057 China Tel: +86 755 3330 5088 Fax: +86 755 3330 5099 customercare.shzn@te.com te.com/sensorsolutions Measurement Specialties, Inc., a TE Connectivity company. Measurement Specialties (MEAS), American Sensor Technologies (AST), TE Connectivity, TE Connectivity (logo) and EVERY CONNECTION COUNTS are trademarks. All other logos, products and/or company names referred to herein might be trademarks of their respective owners. The information given herein, including drawings, illustrations and schematics which are intended for illustration purposes only, is believed to be reliable. However, TE Connectivity makes no warranties as to its accuracy or completeness and disclaims any liability in connection with its use. TE Connectivity‘s obligations shall only be as set forth in TE Connectivity‘s Standard Terms and Conditions of Sale for this product and in no case will TE Connectivity be liable for any incidental, indirect or consequential damages arising out of the sale, resale, use or misuse of the product. Users of TE Connectivity products should make their own evaluation to determine the suitability of each such product for the specific application. © 2016 TE Connectivity Ltd. family of companies All Rights Reserved.