• slider image 514
  • slider image 516
  • slider image 517
  • slider image 518
  • slider image 519
:::


Browsing this Thread:   2 Anonymous Users






Re: PIC i2c slave device id address怪怪的
#4
版主
版主


查看用戶資訊
Slave 端的 SSPAD 只要考慮 B1~B7 ,B0 不要管它,位址只有較高的七個位元有用。

R/W 位元在 Slave 端是由接收的硬體判定的,而且是Match Slave Address (7-bits) 後才判斷的。

7-bit Salve Address + 1-bit R/W 組合起來變成 8-bits command

發表於: 2007/3/12 19:22
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC i2c slave device id address怪怪的
#3
中級會員
中級會員


查看用戶資訊
版主你好:

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
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: PIC i2c slave device id address怪怪的
#2
版主
版主


查看用戶資訊
Slave 端的 SSPADD 暫存器的值為何? 不可為0x00 (GeneralCall)

發表於: 2007/3/9 17:50
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


PIC i2c slave device id address怪怪的
#1
中級會員
中級會員


查看用戶資訊
版主,大家好~

在使用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
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







You can view topic.
不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------