EasyManua.ls Logo

Cmsemicon CMS32L051 - Page 523

Default Icon
703 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
V1.2.2
CMS32L051 User Manual |Chapter 14 Serial interface IICA
www.mcu.com.cn 523 / 703
Yes
(1)
Master operation of a single-master system
Figure 14-27 Master operation of a single-master system
START
configure PER0 register
Configure Port
IICWLnIICWHnXXH
SVAnXXH
IICFn0XH
Configure STCENn
IICRSVn=0
Configure IICCTLn1
IICCTLn00XX011XXB
ACKEn=WTIMn=SPIEn=1
IICCTLn01XX111XXB
IICEn=1
Configure Port
STCEN=1
release serial interface IICA from reset state,
start providing clock.
configure pins and multiplexed ports to be used.
First port configured to be input mode and output latch
set to 
select transmission clock
configure local address
configure start condition
allows I2C bus outupt after configure Port from input mode
to output mode.
initial configuration
communication process
No
I2C bus initialization. Note.
SPTn=1
does INTIICAn interrupt
occur?
No
prepare starting
communication. (generate
stop condition)
wait for detection of
stop condition
Yes
Yes
STTn=1
prepare starting
communication. (generate start
condition)
Write IICAn
start communicating. (determined
address and transmission direction)
does INTIICAn interrupt
occur?
No
Yes
ACKDn=1
Yes
TRCn=1
Yes
Write IICAn
does INTIICAn interrupt
occur?
No
Yes
ACKDn=1
Yes
transmission
completes?
Yes
restart?
Yes
No
No
SPTn=1
END
ACKEn=1
WTIMn=0
WRELn=1
does INTIICAn interrupt
occur?
No
Yes
Write IICAn
transmission
completes?
start
transmission
wait for
receiving data
start
transmission
wait for
receiving data
No
Yes
ACKEn=0
WTIMn=1
WRELn=1
does INTIICAn interrupt
occur?
No
Yes
wait for detecing
acknowledgement
Note I
2
C-bus (SCLAn pins and SDAAn pins are high) must be released according to the specifications of the
product in the communication. For example, if the EEPROM is in a state of output low to the SDAAn pin,
the SCLAn pin must be set to the output port and clock pulses from the output port before the SDAAn
pin is fixed high.
Remark 1. The format sent and received must conform to the
specifications of the product in the communication.
2.n=0
Communi
cation
processin
g

Table of Contents

Related product manuals