Re: PIC i2c slave device id address怪怪的
|
||||
---|---|---|---|---|
中級會員
|
版主你好:
I2C slave id 7 bits MSB LSB | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | LSB=1 Read, LSB=0 Write 可以通訊環境: ----master----- 要讀取i2c slave id 0x10上的資料 -----slave----- SSPADD slave ID設定為=0x10 我的問題是----- 1. slave上所設定的SSPADD值範圍是否為0x01~0x7F? 2. 當master要送出讀1個byte, 包含7-bit及1個R\W位元 時, slave id是否要先左移1個位元後再加上1個R\W位元 ,成為1個byte後再送出? 實際上我沒有先左移直接加1後 傳出也可以通 3. 依I2C規格上來看, master送出slave id(7-bit)(讀取時)應是 先左移1個位元後再加上1個R\W位元, 再送出, 還是PIC比較 特別呢? 謝謝啦!
發表於: 2007/3/12 19:02
|
|||
|
Re: PIC i2c slave device id address怪怪的
|
||||
---|---|---|---|---|
版主
|
Slave 端的 SSPADD 暫存器的值為何? 不可為0x00 (GeneralCall)
發表於: 2007/3/9 17:50
|
|||
|
PIC i2c slave device id address怪怪的
|
||||
---|---|---|---|---|
中級會員
|
版主,大家好~
在使用PIC(16f877a) i2c 時, 發現有點怪怪的, 環境為使用兩顆PIC, 一為master,另一為slave(7bit),做通訊 i2c的spec, slave device id address 7bit 應是0x00~0x7f對吧 但實際上設定測試可以由0x00~0xf0都可以通訊, 0xf1以上就不行,這樣子PIC的i2c slave id是否是正常的呢? i2c master端程式 //-------------------------------------------- u8 read_i2c(u8 id, u8 add) { u8 data,id_read; id_read = id + 1; i2c_start(); i2c_write(id); // eeprom device id i2c_write(add); i2c_repStart(); i2c_write(id_read); data=i2c_read(0); i2c_stop(); return(data); } 謝謝!!!
發表於: 2007/3/7 18:28
|
|||
|