www
.mcu.com.cn
184
/
239
Rev.
1.00
CMS80F731x Reference Manual
21.3.2
I2C Master Mode Control and Status Registers
The control registers include 4 bits: RUN, START, STOP, ACK bits. The START bit will produce the START or RESTART
START condition. The STOP bit determines whether the data transfer stops at the end of the cycle, or continues. To generate a
single transmission cycle, the slave address register writes to the desired address, the R/S bit is set to 0, and the control register
writes to ACK=x, STOP=1, START=1, RUN=1 (I2CMCR=xxx0_x111x) to perform the operation and stop. An interrupt occurs
when the operation completes (or an error occurs). Data can be read from the receiving data register.
When I2C is operating in master mode, the ACK bit must be set to 1. This will cause the I2C-Bus controller to automatically
send a reply after each byte. When the I2C-bus controller no longer needs to send data from the slave, the bit must clear 0.
Master mode control registers
0xF5
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
I2CMCR
RSTS
--
--
--
ACK
STOP
START
RUN
R/W
In
R
R
In
In
In
In
In
Reset value
0
0
1
0
0
0
0
0
Bit7
RSTS:
I2C active module reset control position;
1=
Reset the master module (I2C
registers for the entire master module
, including I2CMSR);
0=
The interrupt flag bit in I2C master mode is clear to 0.
Bit6~Bit5
--
Retain.
Bit4
--
Reserved, must be 0.
Bit3
ACK:
Answer enable bit;
1=
Enable;
0=
Disable.
Bit2
STOP:
Stop enable bit;
1=
Enable;
0=
Disable.
Bit1
START:
Start the enable bit;
1=
Enable;
0=
Disable.
Bit0
RUN:
Run the enable bit;
1=
Enable;
0=
Disable.
Various operations in master mode can be implemented through the following list of control bit combinations:
START: Sends a start signal.
SEND: Send data or address.
RECEIVE: Receives data.
STOP: Send an end signal.