Operation Flow Of I 2 C Interface - Fujitsu MB90335 Series Hardware Manual

16-bit microcontroller
Table of Contents

Advertisement

2
CHAPTER 19 I
C INTERFACE
2
19.3 I
C Interface Operation
19.3.3
Operation Flow of I
Figure 19.3-4 shows the operation flow of a master send/receive program (with
interrupts) for the I
program (with interrupts) for the I
■ Operation Flow of I
Figure 19.3-4 Operation Flow of the Master Send/Receive Program (with Interrupts) for the I
Main routine
Start
Set the slave
address
2
I
C operating enabled
Master
receive operation?
Master send
NO
Set the number of bytes to be sent
for each time that data is written
Send the slave address set
(Data direction bit=0)
YES
BBbit=1?
NO
Generate the start condition
while sending the slave address
Wait for a certain
amount of time
YES
BB bit=0 and
AL bit=1?
2
I
C operation disabled
NO
LOOP
452
2
C interface. Figure 19.3-5 shows the operation flow of the slave
2
C interface.
2
C Interface
Master receive
Set the number of bytes
to be sent for each
time that data is written
Receive the slave address set
(Data direction bit=1)
YES
BBbit=1?
NO
Generate the start condition
while sending the slave address
Wait for a certain
amount of time
YES
BB bit=0 and
AL bit=1?
2
I
C operation disabled
NO
LOOP
FUJITSU MICROELECTRONICS LIMITED
2
C Interface
Interrupt routine
Start
YES
Bus error
occurred?
NO
AL occurred?
NO
NO
Master?
YES
NO
Was ACK
returned?
YES
NO
Is the data direction
bit (TRX)=1?
YES
YES
Is the number
of remaining bytes to
be sent 0?
NO
Decrement the number of bytes to be sent
Set the send data
Clear the end interrupt factor
RETI
MB90335 Series
2
1
STOP condition generated
Clear the bus error
interrupt factor
2
RETI
2
I
C operation enabled
2
I
3
3
Acknowledge occurrence enabled
To the slave program
3
interrupt routine
1
YES
Is the number
of remaining bytes to
1
be received 0?
NO
YES
Is the number
1
of remaining bytes to
be received 1?
NO
Acknowledge occurrence enabled
Acknowledge occurrence enabled
YES
Is the first byte
being received?
NO
Decrement the number of bytes to be received
Store the receive data to the RAM
Clear the end interrupt factor
RETI
CM44-10137-6E
C Interface
2
C initial setting
RETI

Advertisement

Table of Contents
loading

This manual is also suitable for:

F2mc-16lxMb90v330aMb90f337Mb90337

Table of Contents