当前位置:网站首页>Precautions for RTD temperature measurement of max31865 module
Precautions for RTD temperature measurement of max31865 module
2022-07-05 18:39:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
max31865 modular RTD Precautions for temperature measurement
- matters needing attention 1 Reference resistance
- matters needing attention 2 connection
- matters needing attention 3 Electrical connections
- matters needing attention 4 max31865 Important details of the module
- matters needing attention 5 SPI Timing interval
- matters needing attention 6 max31865 The reason why the register data cannot be read
- Reference code
matters needing attention 1 Reference resistance
The PT100 version of the breakout uses 430Ω The PT1000 version uses 4300Ω commonly PT100 choose 400 Ohm reference resistance , But what is given on the board is 4300, That is to say 430Ω. The program needs to set the reference resistance to 430,PT1000 choice 4300Ω. #define REF_RES 430
matters needing attention 2 connection
There are three positions on the board for setting the line .
matters needing attention 3 Electrical connections
Power Pins: Vin – this is the power pin. Since the chip uses 3 VDC, we have included a voltage regulator on board that will take 3-5VDC and safely convert it down. To power the board, give it the same power as the logic level of your microcontroller – e.g. for a 5V micro like Arduino, use 5V 3Vo – this is the 3.3V output from the voltage regulator, you can grab up to 100mA from this if you like GND – common ground for power and logic
SPI Logic pins: All pins going into the breakout have level shifting circuitry to make them 3-5V logic level safe. Use whatever logic level is on Vin!
SCK – This is the SPI Clock pin, its an input to the chip SDO – this is the Serial Data Out / Microcontroller In Sensor Out pin, for data sent from the MAX31865 to your processor SDI – this is the Serial Data In / Microcontroller Out Sensor In pin, for data sent from your processor to the MAX31865 CS – this is the Chip Select pin, drop it low to start an SPI transaction. Its an input to the chip If you want to connect multiple MAX31865’s to one microcontroller, have them share the SDI, SDO and SCK pins. Then assign each one a unique CS pin.
RDY (Ready) – is a data-ready indicator pin, you can use this pin to speed up your reads if you are writing your own driver. Our Arduino driver doesn’t use it to save a pin.
matters needing attention 4 max31865 Important details of the module
SPI Read and write its register , The register is shown in the figure below . Configuration register , Want to read 0x00, Want to write to write 0x80. Transformed RTD Values are stored in 0x01 and 0x02 this 2 individual 8 Bit register . You can set the upper and lower limit of the error alarm threshold , Generally speaking , For example, a PT100 The range of temperature measurement is -200℃ To 420℃, The user wants to set the lower limit alarm value to -180℃, The upper limit alarm value is 400℃, So when max31865 transformation RTD after , Will 0x01 and 0x02 The register result is compared with the upper and lower limit values , If it is not within the set range , An error flag will be generated . Error flag exists 0x07 In the register . Read the temperature process : (1) Read 0x07 register , See if it's equal to 0x00, That is to say, there is no error mark . When there is an error sign ,0x07 A value in the register is 1.
The error flag can be cleared manually , But if the problem is not actually solved , The next time you check this flag, it will still be pulled up by the module .
(2) If you can pass error detection , Start the following process . towards 0x80 Write configuration , What is written here is to perform a conversion (One_Shot_Conversion ), And then wait DRDY The pin becomes low ( It means that the conversion is over ). Then read 0x01 and 0x02 this 2 individual 8 Bit register ,0x02 The lowest position of the is equipped with the wrong sign , If you are right, you can use 0x01 and 0x02 this 2 individual 8 Bit register synthetic resistance value .
4)PT100 Resistance becomes temperature This will show their magic power , There are various conversion formulas .
matters needing attention 5 SPI Timing interval
matters needing attention 6 max31865 The reason why the register data cannot be read
Sending data from the machine also requires the host to provide clock signals
Reference code
// Use RT1052 LPSPI3
//LPSPI3: Read and write a byte
//TxData: Bytes to write
// Return value : Bytes read
uint8_t LPSPI3_ReadWriteByte(uint8_t TxData)
{
uint8_t spirxdata=0;
uint8_t spitxdata=TxData;
lpspi_transfer_t spi_tranxfer;
lpspi_master_handle_t master_handle;
spi_tranxfer.configFlags=kLPSPI_MasterPcs1|kLPSPI_MasterPcsContinuous; //PCS1
spi_tranxfer.txData=&spitxdata; // Data to send
spi_tranxfer.rxData=&spirxdata; // Data to be received
spi_tranxfer.dataSize=1; // Data length
LPSPI_MasterTransferBlocking(LPSPI3,&spi_tranxfer); //SPI Blocking transmission
// LPSPI_MasterTransferNonBlocking(LPSPI3, &master_handle, &spi_tranxfer);
return spirxdata;
}uint8_t max31685_ReadRegister8(uint8_t addr)
{
uint8_t ret;
GPIO_PinWrite(BOARD_USER_SPI_CS0, BOARD_USER_SPI_CS0_PIN, 1U);
SysTick_DelayTicks(1U);
GPIO_PinWrite(BOARD_USER_SPI_CS0, BOARD_USER_SPI_CS0_PIN, 0U);
SysTick_DelayTicks(1U);
ret = LPSPI3_ReadWriteByte(addr);
SysTick_DelayTicks(1U);
ret = LPSPI3_ReadWriteByte(0xff);
SysTick_DelayTicks(1U);
GPIO_PinWrite(BOARD_USER_SPI_CS0, BOARD_USER_SPI_CS0_PIN, 1U);
return ret;
}uint8_t max31685_WriteRegister8(uint8_t addr, uint8_t data)
{
uint8_t ret;
GPIO_PinWrite(BOARD_USER_SPI_CS0, BOARD_USER_SPI_CS0_PIN, 1U);
SysTick_DelayTicks(1U);
GPIO_PinWrite(BOARD_USER_SPI_CS0, BOARD_USER_SPI_CS0_PIN, 0U);
SysTick_DelayTicks(1U);
ret = LPSPI3_ReadWriteByte(addr | 0x80);
SysTick_DelayTicks(1U);
ret = LPSPI3_ReadWriteByte(data);
SysTick_DelayTicks(1U);
GPIO_PinWrite(BOARD_USER_SPI_CS0, BOARD_USER_SPI_CS0_PIN, 1U);
return ret;
}void max31865_Init(void)
{
uint8_t ret; //for test
GPIO_PinWrite(BOARD_USER_SPI_CS0, BOARD_USER_SPI_CS0_PIN, 1U);
SysTick_DelayTicks(10U);
//BIAS ON, Automatically , Three line ,50Hz
max31685_WriteRegister8(MAX31856_CONFIG_REG, MAX31856_CONFIG_BIAS | MAX31856_CONFIG_MODEAUTO | MAX31856_CONFIG_3WIRE | MAX31856_CONFIG_FILT50HZ);
ret = max31685_ReadRegister8(MAX31856_CONFIG_REG);
}uint8_t max31865_ReadFault(void)
{
}
void max31865_ClearFault(void)
{
}
void max31865_Config(uint8_t reg, uint8_t cfgValue)
{
}
uint16_t max31865_ReadRTD(void)
{
uint16_t rtd = 0;
rtd = max31685_ReadRegister8(MAX31856_RTDMSB_REG) << 8;
rtd |= max31685_ReadRegister8(MAX31856_RTDLSB_REG);
rtd = rtd >> 1;
return rtd;
}Reference link 1: https://learn.adafruit.com/adafruit-max31865-rtd-pt100-amplifier?view=all Reference link 2: https://blog.csdn.net/x1131230123/article/details/105446353?spm=1001.2014.3001.5506
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/149824.html Link to the original text :https://javaforall.cn
边栏推荐
- The 11th China cloud computing standards and Applications Conference | China cloud data has become the deputy leader unit of the cloud migration special group of the cloud computing standards working
- What is the reason why the video cannot be played normally after the easycvr access device turns on the audio?
- 【HCIA-cloud】【1】云计算的定义、什么是云计算、云计算的架构与技术说明、华为云计算产品、华为内存DDR配置工具说明
- The 2022 China Xinchuang Ecological Market Research and model selection evaluation report released that Huayun data was selected as the mainstream manufacturer of Xinchuang IT infrastructure!
- 进程间通信(IPC):共享内存
- Various pits of vs2017 QT
- 【在优麒麟上使用Electron开发桌面应】
- sample_rate(采樣率),sample(采樣),duration(時長)是什麼關系
- jdbc读大量数据导致内存溢出
- ConvMAE(2022-05)
猜你喜欢

The main thread anr exception is caused by too many binder development threads

Rse2020/ cloud detection: accurate cloud detection of high-resolution remote sensing images based on weak supervision and deep learning

About Estimation with Cross-Validation

中文版Postman?功能真心强大!

The 2022 China Xinchuang Ecological Market Research and model selection evaluation report released that Huayun data was selected as the mainstream manufacturer of Xinchuang IT infrastructure!

LeetCode 6111. 螺旋矩阵 IV

How to write good code defensive programming

websocket 工具的使用

第十届全球云计算大会 | 华云数据荣获“2013-2022十周年特别贡献奖”

达梦数据库udf实现
随机推荐
Electron安装问题
SAP feature description
【HCIA-cloud】【1】云计算的定义、什么是云计算、云计算的架构与技术说明、华为云计算产品、华为内存DDR配置工具说明
ICML2022 | 长尾识别中分布外检测的部分和非对称对比学习
Find in MySQL_ in_ Detailed explanation of set() function usage
7-1 linked list is also simple fina
Is it safe for golden sun to open an account? Can I open an account free of 5 in case?
Reptile 01 basic principles of reptile
The 11th China cloud computing standards and Applications Conference | China cloud data has become the deputy leader unit of the cloud migration special group of the cloud computing standards working
RPC protocol details
U-Net: Convolutional Networks for Biomedical Images Segmentation
深入底层C源码讲透Redis核心设计原理
爬虫01-爬虫基本原理讲解
开户注册股票炒股安全吗?有没有风险的?靠谱吗?
Various pits of vs2017 QT
在通达信上做基金定投安全吗?
Electron installation problems
vulnhub之darkhole_2
JDBC reads a large amount of data, resulting in memory overflow
金太阳开户安全吗?万一免5开户能办理吗?