2 structure of messages on the spi, 4 error handling on the i·c bus, 2 structure of messages on the spi 19.8.4 – Siemens AC75 User Manual

Page 502: Error handling on the i²c bus, Table 19.5, 4 error handling on the i²c bus

Advertising
background image

AC75 AT Command Set

19.8 AT^SSPI

s

AC75_ATC_V01.002

Page 502 of 569

10/30/06

Confidential / Released

a Response Frame. The Transfer Frame contains a Receive or Transmit Request (R/W Request) for the I²C mas-

ter.

In a Transfer Message (Read or Write), the third element is the 7-bit I²C Slave Address (2 characters) that iden-

tifies each single device connected to the bus. The 8

th

bit of this byte is the LSB that determines the direction of

the message. If the LSB is "0" the master will write information to the selected slave. If the LSB is "1" the master

will read information sent from the slave.

In a Read Transfer Message on the I²C bus, the size of the expected data must be specified explicitly. This is an

element of 4 characters stating the number of bytes to be read. It must be placed after the I²C Slave Address.

19.8.3.2

Structure of Messages on the SPI

Table 19.5: Structure of Transfer and Response Messages for SPI

The SPI has two serial data lines, DO (I2CDAT_SPIDO) for sending data from the master to the slave, and DI

(SPIDI) for receiving data sent from the slave to the master. Both data lines are controlled by one serial clock

line CLK (I2CCLK_SPICLK). AC75 acts as master providing the clock. Write and read data are handled in the

same Transfer Messages and Response Messages. In a Transfer Message, the next two elements after the ID

are the Read Offset and the Read Length, both required to enable reading data from the slave. The Read Offset

specifies where to start reading, i.e. which byte is the first to start reading from. If the Read Offset is zero then

reading starts from the first byte. The Read Length specifies the number of expected bytes. If the Read Offset is

zero and the Read Length does not equal zero, the master reads the specified number of bytes, starting from the

first byte. If the Read Length is zero, the Read Offset is ignored, meaning that the master will not read data from

the slave. To transmit data from the master to the slave all data can be entered after the Read Length.

In a Response Message the ID is followed by a special character to indicate the result of reading. If successful,

"+" is given, followed by the read data. If reading fails only "!" is received.

19.8.4

Error Handling on the I²C Bus

Protocol error:

If a protocol error is detected the ASCII value "!" is sent to the AT interface. Also, a Stop Condition is sent to the

I²C device.

A protocol error occurs if
• any data / address characters do not equal 0...9, a...f and A...F
• the length of a read word is smaller or greater than 16 bits
• the number of ASCII data is odd (e.g. "af1" instead of "af01")
• the Read or Write request is greater than 2 KB (0x0800).
Acknowledge:

Once a transmission has completed successfully (Write or Read), the special character "+" (ACK) is included in

the Response sent to the AT interface.

During a Write Transfer, the I²C driver acknowledges each transferred byte, but the Response contains only one

ACK which is transmitted only if all bytes are successfully transferred. During a Read Transfer, an ACK is sent

Message

Format

Transfer Message

< ID ReadOffset ReadLength Data >

Read Offset = 8 bits

Read Length = 16 bits

Read Offset + Read Length

≤ 2048 bytes

Max. length of read data: 2048 bytes

Response Message

Write OK

Reading x bytes was OK

Protocol error in x

th

byte

{ID +}

{ID + Data }

{ID ! xxxx }

Advertising