在下,
不太懂如何使用PIC16F877的I2C介面, 將Master Device 的資料傳入Sleve Device.
條件如下~~
MCU: PIC16F877 (Master device)
另外使用一顆具有SDA/SCL的IC 當作Sleve Device
OSC=16MHz
看了PIC16F877的Datasheet後, 有介紹其寫入程序, 但看不太懂??
疑問1:需要寫Start bit 條件嗎? 還是只要單純將Start eanble bit(SEN) in SSPCON2致能即可呢?
疑問2:如何Address / data 1 / data 2由Master device 傳送到Sleve 呢? 是不是只需要將7bits的資料寫入SSPBUF後, I2C自然會將資料傳給Sleve device 呢?
以上是小弟的問題點?煩請各位大大, 不吝給予指導! 感謝