73S1217F Data Sheet
DS_1217F_002
1.7.13 I2C Master Interface
The 73S1217F includes a dedicated fast mode, 400kHz I2C Master interface. The I2C interface can read
or write 1 or 2 bytes of data per data transfer frame. The MPU communicates with the interface through
six dedicated SFR registers:
•
•
•
•
•
•
Device Address (DAR)
Write Data (WDR)
Secondary Write Data (SWDR)
Read Data (RDR)
Secondary Read Data (SRDR)
Control and Status (CSR)
The DAR register is used to set up the slave address and specify if the transaction is a read or write
operation. The CSR register sets up, starts the transaction and reports any errors that may occur. When
the I2C transaction is complete, the I2C interrupt is reported via external interrupt 6. The I2C interrupt is
automatically de-asserted when a subsequent I2C transaction is started. The I2C interface uses a 400kHz
clock from the time-base circuits.
1.7.13.1
I2C Write Sequence
To write data on the I2C Master Bus, the 80515 has to program the following registers according to the
following sequence:
1. Write slave device address to Device Address register (DAR). The data contains 7 bits for the slave
device address and 1 bit of op-code. The op-code bit should be written with a ‘0’ to indicate a write
operation.
2. Write data to Write Data register (WDR). This data will be transferred to the slave device.
3. If writing 2 bytes, set bit 0 of the Control and Status register (CSR) and load the second data byte to
Secondary Write Data register (SWDR).
4. Set bit 1 of the CSR register to start I2C Master Bus.
5. Wait for I2C interrupt to be asserted. It indicates that the write on I2C Master Bus is done. Refer to
information about the INT6Ctl, IEN1 and IRCON register for masking and flag operation.
60
Rev. 1.2