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 Sequential Read<br />

Functional Description<br />

The I 2 C sequential read can be initiated by either an I 2 C random read<br />

(described here) or an I 2 C current address read.<br />

The first step in the programming sequence of an I 2 C random read<br />

initiation is to test the i2_cmplt bit for the operation-complete status. The<br />

next step is to initiate a start sequence by first setting the i2_start and<br />

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

(bits 7-1) and write bit (bit 0=0) to the I 2 C Transmitter Data Register. The<br />

i2_cmplt bit is automatically cleared with the write cycle to the I 2 C<br />

Transmitter Data Register.<br />

The I 2 C Status Register must now be polled to test the i2_cmplt and<br />

i2_ackin bits. The i2_cmplt bit becomes set when the device address and<br />

write bit are transmitted, and the i2_ackin bit provides status as to whether<br />

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

transmission of the device address, the initial word address is loaded into<br />

the I 2 C Transmitter Data Register to be transmitted to the slave device.<br />

Again, i2_cmplt and i2_ackin bits must be tested for proper response.<br />

At this point, the slave device is still in a write mode. Therefore, another<br />

start sequence must be sent to the slave to change the mode to read by first<br />

setting the i2_start, i2_ackout, and i2_enbl bits in the I 2 C Control Register<br />

and then writing the device address (bits 7-1) and read bit (bit 0=1) to the<br />

I 2 C Transmitter Data Register. After i2_cmplt and i2_ackin bits are tested<br />

for proper response, 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 />

After the I 2 C master controller has received a byte of data (indicated by<br />

i2_datin=1 in the I 2 C Status Register) and the i2_cmplt bit has also been<br />

tested for proper status, the I 2 C master controller responds with an<br />

acknowledge and the system software may then read the data by polling<br />

the I 2 C Receiver Data Register.<br />

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

3

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

Saved successfully!

Ooh no, something went wrong!