29-16
MC9328MX1 Reference Manual
MOTOROLA
I
2
C Module
When the device is functioning as the addressed slave (the IAAS bit in the I2SR is set), the SRW bit in the
I2SR Register is read to determine the direction of the next transfer, and MTX is programmed accordingly.
For slave-mode data cycles (IAAS = 0), the SRW bit is invalid. The MTX bit is read to determine the
current transfer direction.
The following is an example of a software response by a master transmitter in the interrupt routine (see
Figure 29-5 on page 29-17).
29.7.4 Generation of STOP
A data transfer ends when the master signals a STOP, which can occur after all data is sent. When the
master receiver intends to terminate a data transfer, it must inform the slave transmitter by not
acknowledging the last data byte. This is done by setting the TXAK bit in the I2CR Register before reading
the next-to-last byte. Before the last byte is read, a STOP signal must be generated.
29.7.5 Generation of Repeated START
After the data transfer is complete, the master can retain control of the bus by issuing a repeated START.
Instead of sending a STOP signal, the master sends another START signal and sends out another slave
calling address. See Figure 29-3 on page 29-4 for more information.
29.7.6 Slave Mode
When another device initiates communication on the bus, the MC9328MX1 I
2
C module must verify
whether it is addressed as the slave device by checking the I
2
C Addressed as a Slave bit (IAAS) in the
I2SR Register. When IAAS is set, the software reads the SRW bit in the I2SR Register and sets the
Transmit/Receive Mode Select bit (MTX) in the I2CR Register accordingly. Writing to the I2CR Register
clears the IAAS bit automatically. The IAAS bit is set only at the end of the address cycle, even when there
are multiple data bytes transferred.
Initiate a data transfer by writing data to the I2DR Register for slave transmits, or by reading data from the
I2DR Register in slave receive mode. A dummy read of the I2DR Register in slave receive mode releases
the SCL, allowing the master to send data.
In the slave transmitter routine, the Receive Acknowledge bit (RXAK) in the I2SR Register must be tested
before sending the next byte of data. When RXAK is high, the master receiver intends to terminate the data
transfer. The software must switch the MC9328MX1 from transmitter to receiver mode. Reading the I2DR
Register releases the SCL so the master can generate a STOP signal.
29.7.7 Arbitration Lost
When several devices try to engage the bus at the same time, one becomes the master and the hardware
immediately switches the other devices to slave receive mode. Data output to the SDA line stops, however
the serial clock continues to be generated until the end of the byte during which arbitration is lost. An
interrupt occurs at the falling edge of the ninth clock of this transfer.
When a device that is not a master tries to transmit or generate a START, hardware automatically clears
the Master/Slave Mode Select bit (MSTA) in the I2CR Register without signalling a STOP, generates an
interrupt to the ARM920T processor, and sets the Arbitration Lost bit (IAL) in the I2SR Register to
indicate a failed attempt to engage the bus. The slave service routine must first test the IAL bit and clear it
when it is set.
Содержание DragonBall MC9328MX1
Страница 68: ...1 12 MC9328MX1 Reference Manual MOTOROLA Introduction ...
Страница 86: ...2 18 MC9328MX1 Reference Manual MOTOROLA Signal Descriptions and Pin Assignments ...
Страница 116: ...3 30 MC9328MX1 Reference Manual MOTOROLA Memory Map ...
Страница 126: ...4 10 MC9328MX1 Reference Manual MOTOROLA ARM920T Processor ...
Страница 160: ...8 8 MC9328MX1 Reference Manual MOTOROLA System Control ...
Страница 272: ...13 32 MC9328MX1 Reference Manual MOTOROLA DMA Controller ...
Страница 281: ...Programming Model MOTOROLA Watchdog Timer Module 14 9 ...
Страница 282: ...14 10 MC9328MX1 Reference Manual MOTOROLA Watchdog Timer Module ...
Страница 300: ...15 18 MC9328MX1 Reference Manual MOTOROLA Analog Signal Processor ASP ...
Страница 438: ...18 16 MC9328MX1 Reference Manual MOTOROLA Serial Peripheral Interface Modules SPI 1 and SPI 2 ...
Страница 478: ...19 40 MC9328MX1 Reference Manual MOTOROLA LCD Controller ...
Страница 542: ...20 64 MC9328MX1 Reference Manual MOTOROLA Multimedia Card Secure Digital Host Controller Module MMC SD ...
Страница 574: ...21 32 MC9328MX1 Reference Manual MOTOROLA Memory Stick Host Controller MSHC Module ...
Страница 598: ...23 16 MC9328MX1 Reference Manual MOTOROLA Real Time Clock RTC ...
Страница 670: ...24 72 MC9328MX1 Reference Manual MOTOROLA SDRAM Memory Controller ...
Страница 726: ...25 56 MC9328MX1 Reference Manual MOTOROLA SmartCard Interface Module SIM ...
Страница 736: ...26 10 MC9328MX1 Reference Manual MOTOROLA General Purpose Timers ...
Страница 854: ...29 18 MC9328MX1 Reference Manual MOTOROLA I2C Module ...
Страница 900: ...30 46 MC9328MX1 Reference Manual MOTOROLA Synchronous Serial Interface SSI ...
Страница 942: ...32 26 MC9328MX1 Reference Manual MOTOROLA GPIO Module and I O Multiplexer IOMUX ...