English
Language : 

MC68HC05L28 Datasheet, PDF (92/156 Pages) Motorola, Inc – Flexible general-purpose microcomputer
8.5.4 Generation of a STOP signal
A data transfer ends with a STOP signal generated by the master device. A master transmitter can
simply generate a STOP signal after all the data has been transmitted; for example:
MASTX
END
EMASTX
BRSET
LDAA
BEQ
LDAA
STAA
DEC
BRA
BCLR
RTI
0,MSR,END
TXCNT
END
DATABUF
MDR
TXCNT
EMASTX
5,MCR
;IF NO ACKNOWLEDGEMENT,
;BRANCH TO END
;GET VALUE FROM THE
;TRANSMITTING COUNTER
;IF NO MORE DATA, BRANCH TO END
;GET NEXT BYTE OF DATA
;TRANSMIT THE DATA
;DECREASE THE TXCNT
;EXIT
;GENERATE A STOP CONDITION
;RETURN FROM INTERRUPT
If a master receiver wants to terminate a data transfer, it must inform the slave transmitter by not
acknowledging the last byte of data. This can be done by setting the transmit acknowledge bit
(TXAK) before reading the second last byte of data. Before reading the last byte of data, a STOP
signal must be generated first. The following is an example showing how a STOP signal is
generated by a master receiver.
8 MASR
LAMAR
ENMASR
NXMAR
DEC
BEQ
LDA
DECA
BNE
BSET
BRA
BCLR
LDA
STA
RTI
RXCNT
ENMASR
RXCNT
NXMAR
3,MCR
NXMAR
5,MCR
MDR
RXBUF
;LAST BYTE TO BE READ
;CHECK SECOND LAST BYTE TO BE
;READ
;NOT LAST ONE OR SECOND LAST
;SECOND LAST, DISABLE
;ACKNOWLEDGEMENT TRANSMITTING
;NXMAR
;LAST ONE, GENERATE STOP SIGNAL
;READ DATA AND STORE
8.5.5 Generation of a repeated START signal
At the end of the data transfer, if the master still wants to communicate on the bus, it can generate
another START signal, followed by another slave address, without first generating a STOP signal.
For example:
MOTOROLA
8-12
I2C-BUS
TPG
MC68HC05L28