Operation Flow Of I C Interface - Fujitsu F2MC-16LX Hardware Manual

16-bit microcontroller mb90330 series
Hide thumbs Also See for F2MC-16LX:
Table of Contents

Advertisement

22.3.3
Operation Flow of I
Figure 22.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 22.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
2
C interface. Figure 22.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
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
2
CHAPTER 22 I
C INTERFACE
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 occurrance enabled
Acknowledge occurrance enabled
Yes
Is the first bytea
being received?
No
Decrement the number of bytes to be received
Store the receive data to the RAM
Clear the end interrupt factor
RETI
2
C Interface
2
C initial setting
RETI
541

Advertisement

Table of Contents
loading

Table of Contents