17.11.2012 Views

MVME5100 Single Board Computer Programmer's Reference Guide

MVME5100 Single Board Computer Programmer's Reference Guide

MVME5100 Single Board Computer Programmer's Reference Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

I 2 C Byte Write<br />

Functional Description<br />

The I 2 C Status Register contains the i 2 _cmplt bit which is used to indicate<br />

if the I 2 C master controller is ready to perform an operation. Therefore, the<br />

first step in the programming sequence should be to test the i 2 _cmplt bit<br />

for the operation-complete status. The next step is to initiate a start<br />

sequence by first setting the i 2 start and i 2 enbl bits in the I 2 C Control<br />

Register and then writing the device address (bits 7-1) and write bit (bit<br />

0=0) to the I 2 C Transmitter Data Register. The i 2 _cmplt bit will be<br />

automatically clear with the write cycle to the I 2 C Transmitter Data<br />

Register. The I 2 C Status Register must now be polled to test the i 2 _cmplt<br />

and i 2 _ackin bits. The i 2 _cmplt bit becomes set when the device address<br />

and write bit have been transmitted, and the i 2 _ackin bit provides status as<br />

to whether or not a slave device acknowledged the device address. With<br />

the successful transmission of the device address, the word address will be<br />

loaded into the I 2 C Transmitter Data Register to be transmitted to the slave<br />

device. Again, i 2 _cmplt and i2_ackin bits must be tested for proper<br />

response. After the word address is successfully transmitted, the next data<br />

loaded into the I 2 C Transmitter Data Register will be transferred to the<br />

address location selected previously within the slave device. After<br />

i 2 _cmplt and i 2 _ackin bits have been tested for proper response, a stop<br />

sequence must be transmitted to the slave device by first setting the i 2 stop<br />

and i 2 enbl bits in the I 2 C Control Register and then writing a dummy data<br />

(data=don’t care) to the I 2 C Transmitter Data Register. The I 2 C Status<br />

Register must now be polled to test i 2 _cmplt bit for the operation-complete<br />

status. The stop sequence will initiate a programming cycle for the serial<br />

EEPROM and also relinquish the ASIC master’s possession of the I 2 C bus.<br />

Figure 3-5 shows the suggested software flow diagram for programming<br />

the I 2 C byte write operation.<br />

http://www.motorola.com/computer/literature 3-23<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!