I 2 C Bus ControllerI 2 C Interface Setup ExamplesPanasonic Semiconductor Development Company MN102H75K/F75K/85K/F85K LSI User Manual302Panasonic13.6.2 Setting Up a Transition from Slave Receiver to SlaveTransmitterThis example demonstrates how to set up a data transfer when changing fromslave receiver to slave transmitter. Figure 13-8 shows an example waveform.13.6.2.1 Pre-configuringn To set up the I/O port:Set port control register 0 (PCNT0; x’00FF90’) to x’0300’ (enabling the SDA1and SCL1 pins) and set the port 0 output mode register (P0MD; x’00FFF0’) tox’0006’ (selecting the SDA1 and SCL1 functions).n To enable I 2 C interrupts:Set the I 2C interrupt control register pair (I2C0ICH and I2C0ICL; x’00FC9C’) tox’0100’.n To set up the I 2C registers:1. Set the I2CMYAD register (x’007E44’) to x’0024’. This sets the slaveaddress of the microcontroller.2. Set the I2CDTRM register (x’007E40’) to x’0000’. This sets STA, STP,ACK, and the transmission data to 0s. With this setting, the microcontrollerreturns an ACK = 0 signal when an address match occurs. The master sendsdata (the slave address) to the slave microcontroller in sync with the masterclock. When the R/W bit = 1, the microcontroller changes from a slavereceiver to a slave transmitter.13.6.2.2 Setting Up the First InterruptOnce the microcontroller becomes a slave transmitter, set up the transmissiondata.n To set up the interrupt:Set the I2C0ICH and I2C0ICL register pair (x’00FC9C’) to x’0100’. Thisenables I 2 C interrupts and clears the previous interrupt request.n To set up the I 2C registers:1. Read the I2CDREC register (x’007E42’) to determine the I2 C bus controllerstatus. AAS should be 1.2. Set the I2CDTRM register (x’007E40’) to x’0155’. This sets STA to 0, STPto 0, ACK to 1, and the transmission data to x’55’. The microcontroller doesnot need to issue an ACK signal in this transfer, so the ACK bit should be 1.3. Begin transmitting data in sync with the clock from the master.