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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

I 2 C Current Address Read<br />

Functional Description<br />

The I 2 C slave device should maintain the last address accessed during the<br />

last I 2 C read or write operation, incremented by one. The first step in the<br />

programming sequence should be to test the i2_cmplt bit for the operationcomplete<br />

status. The next step is to initiate a start sequence by first setting<br />

the i2_start and i2_enbl bits in the I 2 C Control Register and then writing<br />

the device address (bits 7-1) and read bit (bit 0=1) to the I 2 C Transmitter<br />

Data Register. The i2_cmplt bit will be automatically clear with the write<br />

cycle to the I 2 C Transmitter Data Register. The I 2 C Status Register must<br />

now be polled to test the i2_cmplt and i2_ackin bits. The i2_cmplt bit<br />

becomes set when the device address and read bit have been transmitted,<br />

and the i2_ackin bit provides status as to whether or not a slave device<br />

acknowledged the device address. With the successful transmission of the<br />

device address, the I 2 C master controller writes a dummy value<br />

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

master controller to initiate a read transmission from the slave device.<br />

Again, i2_cmplt bit must be tested for proper response. After the I 2 C<br />

master controller has received a byte of data (indicated by i2_datin=1 in<br />

the I 2 C Status Register), the system software may then read the data by<br />

polling the I 2 C Receiver Data Register. The I 2 C master controller does not<br />

acknowledge the read data for a single byte transmission on the I 2 C bus,<br />

but must complete the transmission by sending a stop sequence to the slave<br />

device. This can be accomplished by first setting the i2_stop and i2_enbl<br />

bits in the I 2 C Control Register and then writing a dummy data (data=don’t<br />

care) to the I 2 C Transmitter Data Register. The I 2 C Status Register must<br />

now be polled to test i2_cmplt bit for the operation-complete status. The<br />

stop sequence will relinquish the ASIC master’s possession of the I 2 C bus.<br />

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

the I 2 C current address read operation.<br />

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

3

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

Saved successfully!

Ooh no, something went wrong!