|
M37160M8 Datasheet, PDF (42/131 Pages) Renesas Technology Corp – SINGLE-CHIP 8-BIT CMOS MICROCOMPUTER | |||
|
◁ |
M37160M8/MA/MF-XXXSP/FP,M37160EFSP/FP
(3) RESTART condition generation procedure
â Procedure example (The necessary conditions for the procedure
are described in â to â
below.)
Execute the following procedure when the PIN bit is â0.â
LDM
LDA
SEI
STA
LDM
CLI
â¢
â¢
#$00, S1
â
S0
#$F0, S1
â¢
â¢
(Select slave receive mode)
(Take out slave address value)
(Interrupt disabled)
(Write slave address value)
(Trigger RESTART condition generating)
(Interrupt enabled)
â Select the slave receive mode when the PIN bit is â0.â Do not write
â1â to the PIN bit. Neither â0â nor â1â is specified for the writing to
the BB bit.
The TRX bit becomes â0â and the SDA pin is released.
â The SCL pin is released by writing the slave address value to the
I2C data shift register. Use âSTA,â âSTXâ or âSTYâ of the zero page
addressing instruction for writing.
â Use âLDMâ instruction for setting trigger of RESTART condition
generation.
â Write the slave address value of â and set trigger of RESTART
condition generation of â continuously, as shown in the above pro-
cedure example.
â
Disable interrupts during the following two process steps:
⢠Write of slave address value
⢠Trigger RESTART condition generation
(4) STOP condition generation procedure
â Procedure example (The necessary conditions for the procedure
are described in â to â below.)
â¢
â¢
SEI
LDM #$C0, S1
NOP
LDM #$D0, S1
CLI
â¢
â¢
(Interrupt disabled)
(Select master transmit mode)
(Set NOP)
(Trigger STOP condition generation)
(Interrupt enabled)
â Write â0â to the PIN bit when master transmit mode is selected.
â Execute âNOPâ instruction after master transmit mode is set. Also,
set trigger of STOP condition generation within 10 cycles after se-
lecting the master trasmit mode.
â Disable interrupts during the following two process steps:
⢠Select master transmit mode
⢠Trigger STOP condition generation
(5) Writing to I2C status register
Do not execute an instruction to set the PIN bit to â1â from â0â and an
instruction to set the MST and TRX bits to â0â from â1â simultaneously
as it may cause the SCL pin the SDA pin to be released after about
one machine cycle. Also, do not execute an instruction to set the
MST and TRX bits to â0â from â1â when the PIN bit is â1,â as it may
cause the same problem.
(6) Process of after STOP condition generation
Do not write data in the I2C data shift register S0 and the I2C status
register S1 until the bus busy flag BB becomes â0â after generation
the STOP condition in the master mode. Doing so may cause the
STOP condition waveform from being generated normally. Reading
the registers does not cause the same problem.
Rev.1.01 2003.11.13 page 42 of 130
|
▷ |