i2c_txrx_byte Routine
MSC8113 Reference Manual, Rev. 0
Freescale Semiconductor
24-5
24.2 i2c_txrx_byte Routine
The i2c_txrx_byte routine transmits or receives a byte on the I
2
C Bus. It also checks the ACK bit
(for a write) or asserts the ACK bit (for a read). The routine returns to a higher routine for a lost
arbitration or a start/stop condition, indicated when the txrx_bit routine sets the T bit.
32
and d8,d2
33
iff rts
Exit on SCl low.
34
cmpeq d3,d2
Check for SDA change while in HIGH_PERIOD (SCL = 1).
T bit set for arbitration lost start/stop condition.
35
nop
36
ift rts
Start/stop condition indication to higher routine.
37
cmpeq d8,d2
Check for SDA value.
38
nop
39
ift bmset #1,d6.l
Set D6 according to receive/write bit value.
40
deceq d0
41
bf hperiod_loop
42
bmtstc #$1,d7.l
43
nop
44
iff rts
Write session, no need to check for arbitration lost.
45
bmtstc #$1,d6.l
Check for arbitration lost in write session.
46
move.l r0,d1
47
iff move.w #SCL_SDA_10,d0
48
ift tfr d8,d0
49
cmpeq d0,d1
Set T bit for arbitration lost indication for higher routines.
50
rts
Table 24-4. HIGH_PERIOD and HALF_LOW_PERIOD Timing
Parameter
Core_Clock/Unit
at Core/Bus = 3
Core_Clock/Unit
at Core/Bus = 4
Core_Clock/Unit
at Core/Bus = 5
Core_Clock/Unit
at Core/Bus = 6
Initial value
(Set at boot
code)
HIGH_PERIOD
82
95
105
115
64
HALF_LOW_PERI
OD
5
5
5
5
512
Global Register Use
D4, D6, D7.
Local Register Use
Routine call
i2c_txrx_bit
Signal Diagram
Figure 24-3. i2c_txrx_byte Routine
Figure 24-2. i2c_txrx_bit Routine (Continued)
SCL
SDA
Bit 0
Bit 1
Bit 2
Bit 3
Bit 4
Bit 5
Bit 6
Bit 7
ACK Bit
MSB
LSB
Содержание MSC8113
Страница 1: ...MSC8113 Reference Manual Tri Core 16 Bit Digital Signal Processor MSC8113RM Rev 0 May 2008 ...
Страница 20: ...MSC8113 Reference Manual Rev 0 xx Freescale Semiconductor Contents ...
Страница 28: ...MSC8113 Reference Manual Rev 0 xxviii Freescale Semiconductor ...
Страница 56: ...MSC8113 Reference Manual Rev 0 1 28 Freescale Semiconductor MSC8113 Overview ...
Страница 76: ...MSC8113 Reference Manual Rev 0 2 20 Freescale Semiconductor SC140 Core Overview ...
Страница 134: ...MSC8113 Reference Manual Rev 0 4 30 Freescale Semiconductor System Interface Unit SIU ...
Страница 168: ...MSC8113 Reference Manual Rev 0 6 18 Freescale Semiconductor Boot Program ...
Страница 180: ...MSC8113 Reference Manual Rev 0 7 12 Freescale Semiconductor Clocks ...
Страница 260: ...MSC8113 Reference Manual Rev 0 8 80 Freescale Semiconductor Memory Map ...
Страница 300: ...MSC8113 Reference Manual Rev 0 9 40 Freescale Semiconductor Extended Core ...
Страница 304: ...MSC8113 Reference Manual Rev 0 10 4 Freescale Semiconductor MQBus and M2 Memory ...
Страница 308: ...MSC8113 Reference Manual Rev 0 11 4 Freescale Semiconductor SQBus ...
Страница 544: ...MSC8113 Reference Manual Rev 0 16 46 Freescale Semiconductor Direct Memory Access DMA Controller ...
Страница 590: ...MSC8113 Reference Manual Rev 0 17 46 Freescale Semiconductor Interrupt Processing ...
Страница 614: ...MSC8113 Reference Manual Rev 0 18 24 Freescale Semiconductor Debugging ...
Страница 622: ...MSC8113 Reference Manual Rev 0 19 8 Freescale Semiconductor Internal Peripheral Bus IPBus ...
Страница 724: ...MSC8113 Reference Manual Rev 0 21 32 Freescale Semiconductor UART ...
Страница 920: ...MSC8113 Reference Manual Rev 0 25 150 Freescale Semiconductor Ethernet Controller ...
Страница 1171: ...MSC8113 Reference Manual Rev 0 Freescale Semiconductor C 61 EF wait_rts P 01077FFC 9F rts 71 ...
Страница 1172: ...MSC8113 Reference Manual Rev 0 C 62 Freescale Semiconductor MSC8113 Boot Code ...
Страница 1202: ...MSC8113 Reference Manual Rev 0 Index 30 Freescale Semiconductor Index ...