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.
Summary of Contents for DragonBall MC9328MX1
Page 68: ...1 12 MC9328MX1 Reference Manual MOTOROLA Introduction ...
Page 86: ...2 18 MC9328MX1 Reference Manual MOTOROLA Signal Descriptions and Pin Assignments ...
Page 116: ...3 30 MC9328MX1 Reference Manual MOTOROLA Memory Map ...
Page 126: ...4 10 MC9328MX1 Reference Manual MOTOROLA ARM920T Processor ...
Page 160: ...8 8 MC9328MX1 Reference Manual MOTOROLA System Control ...
Page 272: ...13 32 MC9328MX1 Reference Manual MOTOROLA DMA Controller ...
Page 281: ...Programming Model MOTOROLA Watchdog Timer Module 14 9 ...
Page 282: ...14 10 MC9328MX1 Reference Manual MOTOROLA Watchdog Timer Module ...
Page 300: ...15 18 MC9328MX1 Reference Manual MOTOROLA Analog Signal Processor ASP ...
Page 438: ...18 16 MC9328MX1 Reference Manual MOTOROLA Serial Peripheral Interface Modules SPI 1 and SPI 2 ...
Page 478: ...19 40 MC9328MX1 Reference Manual MOTOROLA LCD Controller ...
Page 574: ...21 32 MC9328MX1 Reference Manual MOTOROLA Memory Stick Host Controller MSHC Module ...
Page 598: ...23 16 MC9328MX1 Reference Manual MOTOROLA Real Time Clock RTC ...
Page 670: ...24 72 MC9328MX1 Reference Manual MOTOROLA SDRAM Memory Controller ...
Page 726: ...25 56 MC9328MX1 Reference Manual MOTOROLA SmartCard Interface Module SIM ...
Page 736: ...26 10 MC9328MX1 Reference Manual MOTOROLA General Purpose Timers ...
Page 854: ...29 18 MC9328MX1 Reference Manual MOTOROLA I2C Module ...
Page 900: ...30 46 MC9328MX1 Reference Manual MOTOROLA Synchronous Serial Interface SSI ...
Page 942: ...32 26 MC9328MX1 Reference Manual MOTOROLA GPIO Module and I O Multiplexer IOMUX ...