Datasheet
ADuC814
Rev. A | Page 46 of 72
I
2
C COMPATIBLE INTERFACE
The ADuC814 supports a 2-wire serial interface mode that is
I
2
C compatible. The I
2
C compatible interface shares its pins with
the on-chip SPI interface, and therefore the user can enable only
one interface or the other at any given time (see the SPE bit in
SPICON SFR, Table 18). Application Note uC001 describes the
operation of this interface as implemented, and is available on
the MicroConverter website at www.analog.com/microconverter.
This interface can be configured as a software master or hard-
ware slave, and uses two pins in the interface.
SDATA (Pin 24) Serial Data I/O
SCLOCK (Pin 25) Serial Clock
Three SFRs are used to control the I
2
C compatible interface.
I2CCON I
2
C Control Register
SFR Address E8H
Power-On Default 00H
Bit Addressable Yes
MDO MDE MCO MDI I2CM I2CRS I2CTX I2CI
Table 19. I2CCON SFR Bit Designations
Bit No. Name Description
7
MDO I
2
C Software Master Data Output Bit (Master Mode Only).
This data bit is used to implement a master I
2
C transmitter interface in software. Data written to this bit is output on
the SDATA pin if the data output enable (MDE) bit is set.
6
MDE I
2
C Software Master Data Output Enable Bit (Master Mode Only).
Set by the user to enable the SDATA pin as an output (Tx).
Cleared by the user to enable SDATA pin as an input (Rx).
5
MCO I
2
C Software Master Clock Output Bit (Master Mode Only).
This data bit is used to implement a master I
2
C transmitter interface in software. Data written to this bit is output on
the SCLOCK pin.
4
MDI I
2
C Software Master Data Input Bit (Master Mode Only).
This data bit is used to implement a master I
2
C receiver interface in software. Data on the SDATA pin is latched into
this bit on SCLOCK if the data output enable (MDE) bit is 0.
3
I2CM I
2
C Master/Slave Mode Bit.
Set by the user to enable I
2
C software master mode.
Cleared by the user to enable I
2
C hardware slave mode.
2
I2CRS I
2
C Reset Bit (Slave Mode Only).
Set by the user to reset the I
2
C interface.
Cleared by the user code for normal I
2
C operation.
1
I2CTX I
2
C Direction Transfer Bit (Slave Mode Only).
Set by the MicroConverter if the interface is transmitting.
Cleared by the MicroConverter if the interface is receiving.
0
I2CI I
2
C Interrupt Bit (Slave Mode Only).
Set by the MicroConverter after a byte has been transmitted or received.
Cleared automatically when user code reads the I2CDAT SFR (see the I2CDAT SFR description that follows).
I2CADD I
2
C Address Register
Function Holds the I
2
C peripheral address for the part. It may be overwritten by the user code. Application Note uC001 at
www.analog.com/microconverter describes the format of the 7-bit address in detail.
SFR Address 9BH
Power-On Default 55H
Bit Addressable No
I2CDAT I
2
C Data Register
Function The I2CDAT SFR is written to by the user code to transmit data over the I
2
C interface, or it is read by the user
code to read data just received via the I
2
C interface. Accessing the I2CDAT register automatically clears any
pending I
2
C interrupts and the I2CI bit in the I2CCON SFR.
SFR Address 9AH
Power-On Default 00H
Bit Addressable No