极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 22159|回复: 1

arduino read DUT 10bits I2C只能出現128值

[复制链接]
发表于 2020-3-24 07:18:26 | 显示全部楼层 |阅读模式
請問大大們
我想透過Arduino讀跟燒錄OTP for 某個壓力感測器


A/D conversion data acquisition:

I2C硬體接線圖:

I2C硬體接線圖2:

OTP data acquisition:

Reset sequence:


I2C mode:
Conversion start for pressure measurement(A1)0Fh & 49h
Conversion start for temperature measurement(A2) 0Fh & 21h
Reading coefficient X1 0Eh & 20h
Reading coefficient X2 0Eh & 28h
Reading coefficient X3 0Eh & 30h
Reading coefficient X4 0Eh & 38h
Reading coefficient X5 0Eh & 40h
Reading coefficient X6 0Eh & 48h
Reading coefficient X7 0Eh & 50h
Reading coefficient X8 0Eh & 58h
Reading coefficient X9 0Eh & 60h
Reading coefficient X10 0Eh & 68h
Reading coefficient X11 0Eh & 70h
Reading coefficient X12 0Eh & 78h
Reading coefficient X13 0Eh & 80h

arduino code:
#include <Wire.h>
#define Address 0x76

void setup() {
  Serial.begin(9600);
  Wire.begin();
}

void loop() {
//測試先讀兩個值
Serial.print(I2Cread(0x0F,0x49));
Serial.print(I2Cread(0x0E,0x20));

//OTP燒錄不會寫><
//...

}

//呼叫副程式:
void I2Cwrite(byte HighAddress, byte LowAddress, byte data)
{
  Wire.beginTransmission(MIS3600_Address);
  Wire.write(HighAddress);
  Wire.write(LowAddress);
  Wire.write(data);
  Wire.endTransmission();  
}
byte I2Cread(byte HighAddress, byte LowAddress)
{
  Wire.beginTransmission(MIS3600_Address);
  Wire.write(HighAddress);
  Wire.write(LowAddress);
  Wire.endTransmission();  
  Wire.requestFrom(MIS3600_Address,4);

  while(!Wire.available())
{
}

  Wire.read();
}

讀出的值卻是[128]

透過arduino I2C想讀取模組的A1,A2 X1~X13 數位值
硬體的部分I2C已接10K pull hi到3.3V  CS接GND 未接SDO,MCLK,VPP
但是得到的卻都是128的值
另外OTP燒錄也不清除要如何寫 (Write如何應用)

使用 UC6102
Analog-to-Digital Converter IC
感謝大大們

回复

使用道具 举报

发表于 2020-3-24 09:24:52 | 显示全部楼层
你發的圖有問題,請發正確的,這樣才有機會正確理解交流。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-4-24 20:40 , Processed in 0.039712 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表