中级会员
- 积分
- 380
- 金钱
- 380
- 注册时间
- 2018-11-20
- 在线时间
- 61 小时
|
楼主 |
发表于 2019-3-27 10:40:33
|
显示全部楼层
举例:MLX90363 Linear模式:
Linear applications are used when linear motion is present (eg: linear actuator) or it is not possible to mount the sensor on the axis of rotation.
The method of retreiving the data is the same as a rotary application(GET1) however the sensor EEPROM must be programmed with a few
values in order to enable a linear calculation.
(1)写入EEPROM:
//Transmit NOP to reset communication
//EEPROM write should be preceded by a NOP (Ref pg 26, S14.10, Rev 002)
ss1 = 0;
RByte0 = spi.write(0x00);
RByte1 = spi.write(0x00);
RByte2 = spi.write(0xAA);
RByte3 = spi.write(0xAA);
RByte4 = spi.write(0x00);
RByte5 = spi.write(0x00);
RByte6 = spi.write(0xD0);
RByte7 = spi.write(0xAB);
ss1 = 1;
wait_ms(10);
for (int i = 0; i <= 1; i++){
//Transmit MemWrite message
//Requires: Key to address location (two bytes)
// Data to transmit (two bytes)
//Results: NOP Response
ss1 = 0;
if (u8_pass == 0){
RByte0 = spi.write(0x00);
RByte1 = spi.write(0x2A);
RByte2 = spi.write(0x45);
RByte3 = spi.write(0x8F);
RByte4 = spi.write(Addr_102A_LSB);
RByte5 = spi.write(Addr_102A_MSB);
RByte6 = spi.write(0xC3);
RByte7 = spi.write(ComputeCRC(0x00, 0x2A, 0x45, 0x8F,
Addr_102A_LSB, Addr_102A_MSB, 0xC3));
}
else{
RByte0 = spi.write(0x00);
RByte1 = spi.write(0x32);
RByte2 = spi.write(0x13);
RByte3 = spi.write(0x17);
RByte4 = spi.write(Addr_1032_LSB);
RByte5 = spi.write(Addr_1032_MSB);
RByte6 = spi.write(0xC3);
RByte7 = spi.write(ComputeCRC(0x00, 0x32, 0x13, 0x17,
Addr_1032_LSB, Addr_1032_MSB, 0xC3));
}
ss1 = 1;
wait_ms(10);
(2)磁通量三个分量
|
-
|