- 1、本文档共20页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
SerialIO
Serial I/O;Serial I/O with the BASIC Stamp;Parallel Interface;Serial Interface;Synchronous and Asynchronous Serial Communication;Asynchronous Serial Communication;Asynchronous Serial Communication;Using the SEROUT Command;Using the SERIN Command;Synchronous Serial I/O;The I2C Bus;The I2C bus master generates SCL and initiates communication with one of the slave devices. Each device has a unique address for device selection.
A device address can be a combination of bits that are “hard-wired” into the chip design and one or more pins on the device. These pins can be wired High or Low to select an address that doesn’t conflict with other devices on the I2C bus.
Pull-up resistors are required on both the clock and data lines.
A variety of special function integrated circuits are available with I2C interfaces, including memory chips, analog-to-digital converters, digital-to-analog converters and real-time-clocks.
;A START sequence begins a bus transmission by transitioning SDA from High to Low while SCL is High.
A STOP sequence ends a transmission. The Stop sequence occurs when the master brings SDA from Low to High while SCL is High.;A typical I2C bus sequence for writing to a slave:
Send a START sequence
Send the I2C device address with the R/W Low (for Write)
Send the data byte
Optionally send additional data bytes (after repeating START)
Send the STOP sequence after all data bytes have been sent
The Slave responds by setting the ACK bit (Acknowledge);Reading an I2C Slave device usually begins by writing to it. You must tell the chip which internal register you want to read.
I2C Read Sequence
Send the START condition
Send the device address with R/W held Low (for a Write)
Send the number of the register you want to read
Send a repeated START condition
Send the device address with R/W set High (for a Read)
Read the data byte from the slave
Send the STOP sequence;;I2C Programming on the BASIC Stamp;The I2COUT Instruction;The I2CIN Instruction;Other Synchronous Serial Pr
文档评论(0)