Chapter 10. I
2
C Interface
10-17
Programming Guidelines
Figure 10-8. Example I
2
C Interrupt Service Routine Flowchart
Clear I2CSR[MIF]
I2CCR[MSTA]
== 0
== 1
I2CCR[MAL]
I2CCR[MTX]
== 1
== 1
== 0
Clear I2CCR[MAL]
EOI
I2CSR[MAAS]
I2CSR[SRW]
Set I2CCR[MTX]
== 0
Clear I2CCR[MTX]
Write I2CDR
Dummy read
EOI
== 1
Slave Addr. Phase
Slave Data Cycle
I2CCR[MTX]
== 1
== 0
Slave Xmit
I2CSR[RXAK]
== 1
== 0
Write next byte
to I2CDR
EOI
Slave Received
Read I2CDR
and store
All done
Y
N
Set I2CCR[TXAK]
Read I2CDR
(dummy read)
Y
N
Last byte
Next-to-last
Generate
Read I2CDR
and store
EOI
Y
N
Set
Master Rcv
STOP
I2CCR[TXAK]
byte
Last byte
Y
N
I2CSR[RXAK]
== 1
Write next byte
to I2CDR
== 0
EOI
Generate
Master Xmit
STOP
B
== 0
== 1
A
== 0
A
B
I2CSR[MAAS]
B
== 0
== 1
Clear I2CCR[MTX]
End of address phase for
master receive mode?
N
Only one byte
to receive?
Y
Y
Set
I2CCR[TXAK]
Read I2CDR
(dummy read)
Clear I2CCR[MTX]
N
Содержание MPC8240
Страница 1: ...MPC8240UM D Rev 1 1 2001 MPC8240 Integrated Processor User s Manual ...
Страница 38: ...xviii MPC8240 Integrated Processor User s Manual TABLES Table Number Title Page Number ...
Страница 48: ...xlviii MPC8240 Integrated Processor User s Manual Acronyms and Abbreviations ...
Страница 312: ...6 94 MPC8240 Integrated Processor User s Manual ROM Flash Interface Operation ...
Страница 348: ...7 36 MPC8240 Integrated Processor User s Manual PCI Host and Agent Modes ...
Страница 372: ...8 24 MPC8240 Integrated Processor User s Manual DMA Register Descriptions ...
Страница 394: ...9 22 MPC8240 Integrated Processor User s Manual I2O Interface ...
Страница 412: ...10 18 MPC8240 Integrated Processor User s Manual Programming Guidelines ...
Страница 454: ...12 14 MPC8240 Integrated Processor User s Manual Internal Arbitration ...
Страница 466: ...13 12 MPC8240 Integrated Processor User s Manual Exception Latencies ...
Страница 516: ...16 14 Watchpoint Trigger Applications ...
Страница 538: ...B 16 MPC8240 Integrated Processor User s Manual Setting the Endian Mode of Operation ...
Страница 546: ...C 8 MPC8240 Integrated Processor User s Manual ...
Страница 640: ...INDEX Index 16 MPC8240 Integrated Processor User s Manual ...