MCF8316A read operation
over I2C involves the following sequence.
- I2C start
condition.
- The sequence starts with
I2C target Start Byte.
- The Start Byte is followed by
24-bit Control Word. Bit 23 in the control word has to be 1 as it is a read
operation.
- The control word is followed
by a repeated start or normal start.
- MCF8316A
sends the data bytes on SDA. The number of bytes sent by MCF8316A depends on the DLEN field
value in the control word.
- While sending data
bytes, the LSB byte is sent first. Refer the examples below for more
details.
- 16-bit/32-bit Read –
The data from the address mentioned in Control Word is sent
back.
- 64-bit Read – 64-bit
is treated as two 32-bit read. The address mentioned in Control Word
is taken as Addr 0. Addr 1 is calculating internally by MCF8316A by incrementing Addr
0 by 2. A total of 8 data bytes are sent by MCF8316A
. The first 4 bytes (sent in LSB first way) are read from Addr
0 and the next 4 bytes are read from Addr 1.
-
MCF8316A takes some time to
process the control word and read data from the given address. This
involves some delay. It is quite possible that the repeated start
with Target ID will be NACK’d. If the I2C read request
has been NACK’d by MCF8316A,
retry after few cycles. During this retry, it is not necessary to
send the entire packet along with the control word. It is sufficient
to send only the start condition with target ID and read bit.
- If CRC is enabled, then MCF8316A sends an additional CRC byte
at the end. If CRC is enabled, external MCU I2C controller has to
read this additional byte before sending the stop bit. CRC is calculated for
the entire packet (Target ID + W bit, Control Word, Target ID + R bit, Data
Bytes).
- I2C stop
condition.