EasyManuals Logo

Abov A96G166 User Manual

Default Icon
247 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #130 background imageLoading...
Page #130 background image
14. I2C A96G166/A96A166/A96S166 User’s manual
130
14.7.3 Master transmitter
Main software prepares to write/read data to/from the Slave I2C device. The software has to be ready
to get number of data with internal RAM or sending data on internal RAM according to I2C bus
protocol type of the Slave device.
It writes salve address to I2CDR register in the I2C block, then, if it sets a START bit of the I2CMR
register, the I2C block sends the slave address with SCL clock to the Slave device. The I2C block
takes master mode (MASTER bit -> 1) and takes the read/write state (TMODE bit, read (0), write (1))
according to the data direction bit (R/Wî¡­) of device address.
Example software for the master mode is introduced below:
Master write
I2CMR = IICEN+INTEN; // set I2C block( enable IIC block, I2C interrupt)
I2CDR = Slave Address + Write mode; // load target Salve Address
I2CMR |= SRT; // generate start condition and send slave address
I2C interrupt service
If(Master Mode) and (TMODE)
If( ACK and GCALL or ACK and TEND )
If ( Not End of Data )
I2CDR = NEXT DATA; // load target Salve Address
I2CSR = 0xFF; // Byte transmit start
ELSE
I2CMR = IICEN+INTEN+STP; // STOP generation
ELSE
Initialize I2C block // if have ACK error, any error
End of I2C interrupt service

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Abov A96G166 and is the answer not in the manual?

Abov A96G166 Specifications

General IconGeneral
BrandAbov
ModelA96G166
CategoryComputer Hardware
LanguageEnglish

Related product manuals