English
Language : 

IC-LNG_14 Datasheet, PDF (18/30 Pages) IC-Haus GmbH – 16-BIT OPTO ENCODER
iC-LNG 16-BIT OPTO ENCODER preliminary
WITH SPI AND SERIAL / PARALLEL OUTPUTS
SPI INTERFACE
Rev B1, Page 18/30
CS
SCLK
MOSI
MISO
OP7 OP6 OP5 OP4 OP3 OP2 OP1 OP0 ADR7 ADR6 ADR5 ADR4 ADR3 ADR2 ADR1 ADR0
OP7 OP6 OP5 OP4 OP3 OP2 OP1 OP0 ADR7 ADR6 ADR5 ADR4 ADR3 ADR2 ADR1 ADR0 DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
Figure 4: SPI transmission, taking the Read REGISTER opcode as an example (cont.)
General protocol description
iC-LNG’s SPI interface is implemented as an SPI slave
and supports SPI modes 0 and 3, i.e. data is captured
on the rising edge of SCK and the idle polarity of SCK
is insignificant. The idle state of the MISO line is 1;
on a rising edge at CS the MOSI signal is switched
through to the MISO signal.
Data is sent byte by byte with the MSB (most signif-
icant bit) first. Each data transmission starts when a
1-byte opcode is sent by the SPI master (Table 10).
OPCODE
Code
0xB0
0xA6
0xF5
0x8A
0xCF
0xAD
Description
ACTIVATE
Sensor data transmission
Sensor data status
Read REGISTER (cont.)
Write to REGISTER (cont.)
REGISTER status/data
Table 10: Instructions / opcodes
SPI data transmission for register readout takes place
as follows (Figure 4):
OPCODE description
ACTIVATE
iC-LNG’s register and sensor data channels can be
switched on and off using the ACTIVATE command.
The command causes all slaves to zero their RAC-
TIVE and PACTIVE register and to loop-in this register
data between the MOSI and MISO data stream. The
register and sensor or actuator data channels can be
switched on and off using the following data bytes.
After a power-on iC-LNG’s sensor data channel is de-
activated (PACTIVE = 0) and the register communica-
tion is activated (RACTIVE = 1).
CS
SCLK
MOSI
MISO
OP
RAPA 0-3 RAPA 4-7
...
OP
8 cycles
Figure 5: Setting ACTIVATE: RACTIVE/PACTIVE
(several slaves)
1. The master initializes a transmission by a rising
edge at CS.
2. iC-LNG transfers the level from MOSI to MISO.
3. The master transmits the OPCODE and address
ADR through MOSI; iC-LNG immediately outputs
OPCODE and ADR through MISO.
4. iC-LNG transmits the data requested according
to the address.
5. The master ends the command by a falling edge
at CS.
6. iC-LNG switches its MISO output to 1.
Bytes FAIL, VALID, BUSY, and DISMISS in the STA-
TUS byte are reset by the ACTIVATE command (Ta-
ble 14).
RACTIVE
Code
0
1
Description
Register communication deactivated
Register communication activated
Table 11: Register communication
If RACTIVE is not set, on commands Read REGIS-
TER (cont.), Write to REGISTER (cont.) and REG-
ISTER status/data the ERROR bit is set in the SPI
interface STATUS byte (Table 14), indicating that the
command has not been carried out. The slave imme-
diately outputs the data at MISO which has been sent
by the master through MOSI.