SOGO論壇
  登入   註冊   找回密碼
查看: 160662|回覆: 5
列印 上一主題 下一主題

[問題求助] arduino read DUT 10bits I2C只能出現128值 [複製連結]

Rank: 1

狀態︰ 離線
跳轉到指定樓層
1
發表於 2020-3-22 10:27:47 |只看該作者 |倒序瀏覽
請問大大們
我想透過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]
感謝大大們

喜歡嗎?分享這篇文章給親朋好友︰
               感謝作者     

Rank: 1

狀態︰ 離線
2
發表於 2020-3-22 18:16:32 |只看該作者
小弟可能描述不清楚
補充一下:
透過arduino I2C想讀取模組的A1,A2 X1~X13 數位值
硬體的部分I2C已接10K pull hi到3.3V  CS接GND 未接SDO,MCLK,VPP
但是得到的卻都是128的值
另外OTP燒錄也不清除要如何寫 (Write如何應用)
還請大大們 能指點迷津
感謝大大們~

Rank: 5Rank: 5

數位軟體勳章

狀態︰ 離線
3
發表於 2020-3-23 17:02:15 |只看該作者
a91031042 發表於 2020-3-22 18:16  
小弟可能描述不清楚
補充一下:
透過arduino I2C想讀取模組的A1,A2 X1~X13 數位值

1.  請問該IC為何? 這樣可以方便協助Debug
2. OTP 是指One-Time Program ( 一次寫入).一旦寫入一次就不能再改.(寫入方法還是回到第一點該ic為何)
失敗只有一種:那就是半途而廢

Rank: 1

狀態︰ 離線
4
發表於 2020-3-23 18:55:11 |只看該作者
alphi 發表於 2020-3-23 17:02  
1.  請問該IC為何? 這樣可以方便協助Debug
2. OTP 是指One-Time Program ( 一次寫入).一旦寫入一次就不能 ...

alphi大大:
我使用的是ASIC客製化設計的產品
只有附件的Datasheet~
主要是R/W的方式不清楚
謝謝

Rank: 1

狀態︰ 離線
5
發表於 2020-3-23 23:09:00 |只看該作者
a91031042 發表於 2020-3-23 18:55  
alphi大大:
我使用的是ASIC客製化設計的產品
只有附件的Datasheet~

確認過了是使用 UC6102
Analog-to-Digital Converter IC
謝謝~

Rank: 1

狀態︰ 離線
6
發表於 2020-7-1 22:55:44 |只看該作者
Define address 0x76 與函數呼叫的名稱不同
請注意︰利用多帳號發表自問自答的業配文置入性行銷廣告者,將直接禁訪或刪除帳號及全部文章!
您需要登錄後才可以回覆 登入 | 註冊


本論壇為非營利自由討論平台,所有個人言論不代表本站立場。文章內容如有涉及侵權,請通知管理人員,將立即刪除相關文章資料。侵權申訴或移除要求:abuse@oursogo.com

GMT+8, 2024-6-26 06:32

© 2004-2024 SOGO論壇 OURSOGO.COM
回頂部