User manual

Code Mercenaries
13
II
II
OO
OO
--
--
WW
WW
aa
aa
rr
rr
rr
rr
ii
ii
oo
oo
rr
rr
55
55
66
66
Reading data off the IIC is initiated with a
ReportID=3. The initiating report has the following
format:
"command" holds the command byte to be send to
the IIC.
"count" is the number of bytes that should be read
off the IIC after sending the command byte, values
0 to 255 are valid, 0 reads 256 bytes.
A start signal is automatically generated before
sending the command byte and a stop is generated
after the last data byte is received. The read bit in
the address byte is automatically set to avoid bus
problems.
Data is returned in input reports with ID=3 via
endpoint 3. The data is returned in chunks of up to
62 bytes each with an error flag and byte count.
Multiple reports may be returned in reaction to a
read request:
flags contains the following bits:
7 - error, set if slave does not ack command byte
6 - Arb loss bit, 1 = Arbitration lost
5 - data count MSB
4 - data count
3 - data count
2 - data count
1 - data count
0 - data count LSB
Should the IIC slave fail to acknowledge the
command byte, the error flag will be set and the
transaction aborted. IIC does not have an error
condition during the actual reading of data after the
command byte was sent, except for the Arb Loss,
that can occur when another master starts a
transaction at the same time as the IO-Warrior56.
To resolve an Arb Loss the transfer has to be
initiated again.
Clock stretching by the slave to slow down data
transfer is supported by IO-Warrior56.
Multi master configurations are supported by IO-
Warrior56. If the bus is busy (a start was issued by
another master) IO-Warrior56 will wait for a stop
condition before it starts its IIC transaction. In the
case that another master starts using the bus at the
same time as IO-Warrior56 it is possible that an
Arbitration Loss is detected. This happens when
IO-Warrior56 is driving a logical high on SDA but
reads a low.
When that happens IO-Warrior56 will immediately
stop driving SDA but continues to drive SCK until
the end of the current byte and then returns an Arb
Loss error.
V 1.0.3, November 6nd 2012 for chip version V1.1.0.1