
Cinterion
®
EHS6 AT Command Set
19.7 AT^SSPI
EHS6_ATC_V03.001
15/12/3
Confidential / Released
Page 467 of 513
tains a Receive or Transmit Request (R/W Request) for the I²C master.
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.7.2.2
Structure of Messages on the SPI
Table 19.4:
Structure of Transfer and Response Messages for SPI
The SPI has two serial data lines, MOSI for sending data from the master to the slave, and MISO for receiving
data sent from the slave to the master. Both data lines are controlled by one serial clock line SPI_CLK. EHS6
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 read-
ing, 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.7.3
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
Message
Format
Transfer Message
Read data:<
ID ReadOffset ReadLength
>
Write data: <
ID Data
>
Read and write data: <
ID ReadOffset ReadLength Data
>
Read Offset = 8 bits
Read Length = 16 bits
Max. length of data: 2048 bytes
Response Message
Write OK
Reading x bytes was OK
Protocol error in x
th
byte
{
ID +
}
{
ID +
Data
}
{
ID !
xxxx
}