3-36
APPENDIX
3886 Group User’s Manual
3.3 Notes on use
(3)
Procedure for generating RESTART condition
This procedure cannot be applied to M38867M8A and M38867E8A when the external memory is
used and the bus cycle is extended by ONW function.
Procedure example (The necessary conditions for the procedure are described in Items to
below). Execute the following procedure when the PIN bit is “0”.
LDM #$00, S1
(Select slave receive mode)
LDA #SLADR
(Take out slave address value)
SEI
(Disable interrupt)
STA S0
(Write slave address value)
LDM #$F0, S1
(Trigger RESTART condition generation)
CLI
(Enable interrupt)
:
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 as input 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.
Disable interrupts during the following two process steps:
Write slave address value
Trigger RESTART condition generation
(4)
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. Because it may enter the state that the SCL pin is released
and the SDA pin is released after about one machine cycle. Do not execute an instruction to set the
MST and TRX bits to “0” from “1” simultaneously when the PIN bit is “1”. Because it may become
the same as above.
(5)
Process of after STOP condition generating
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 generating the STOP condition in the master mode. Because the STOP
condition waveform might not be normally generated. Reading to the above registers does not have
the problem.
(6)
STOP condition input at 7th clock pulse
The SDA line may be held at LOW even if flag BB is set to “0” when all the following conditions are
satisfied:
The STOP condition is input at the 7th clock pulse while receiving a slave address or data.
The clock pulse is continuously input.
In the slave mode
Countermeasure:
Write dummy data to the I2C shift register or reset the ES0 bit in the S1D register (ES0 = “L”
→
ES0 = “H”) during a stop condition interrupt routine with flag PIN = “1”.
Note: Do not use the read-modify-write instruction at this time. Furthermore, when the ES0 bit is
set to “0”, the SDA pin becomes a general-purpose port ; so that the port must be set to input
mode or output “H”.
(7)
ES0 bit switch
In standard clock mode when SSC = “000102” or in high-speed clock mode, flag BB may switch to
“1” if ES0 bit is set to “1” when SDA is “L”.
Countermeasure:
Set ES0 to “1” when SDA is “H”.