iC-LNB 18-BIT OPTO ENCODER
WITH SPI AND SER/PAR INTERFACES
Rev A1, Page 20/35
SPI INTERFACE
CS
SCLK
OP7 OP6 OP5 OP4 OP3 OP2 OP1 OP0 ADR7 ADR6 ADR5 ADR4 ADR3 ADR2 ADR1 ADR0
MOSI
OP7 OP6 OP5 OP4 OP3 OP2 OP1 OP0 ADR7 ADR6 ADR5 ADR4 ADR3 ADR2 ADR1 ADR0 DB7 DB6 DB5 DB4 DB3 DB2 DB1 DB0
MISO
Figure 5: SPI transmission, taking the read OPCODE REGISTER as an example (continuous)
General protocol description
OPCODE description
iC-LNB’s SPI interface is implemented as an SPI slave
and supports SPI modes 0 and 3, meaning the idle ACTIVATE
time at SCK can be 0 or 1. Data is always accepted on iC-LNB’s register and sensor data channels can be
a rising edge at SCK. The idle state of the MISO line is switched on and off using the ACTIVATE command.
1; on a rising edge at CS the MOSI signal is switched The command causes all slaves to zero their RACTIVE
through to the MISO signal. Data is sent byte by byte and PACTIVE registers and to loop this register data
with the MSB (most significant bit) first.
into the data stream between the MOSI and MISO. The
Each data transmission starts when a 1-byte OPCODE register and sensor or actuator data channels can be
is sent by the SPI master (Table 10). This OPCODE switched on and off using the following data bytes.
selects whether the iC-LNB configuration data (REG- After a power-on iC-LNB’s sensor data channel is dis-
ISTER) or position data (SDAD) should be accessed, abled (PACTIVE = 0) and register communication en-
for instance.
abled (RACTIVE = 1).
CS
OPCODE
Code
0xB0
Command
SCLK
ACTIVATE
RAPA 0-3
RAPA 4-7
0xA6
Sensor data (SDAD) transmission
Sensor data (SDAD) status
REGISTER read (continuous)
REGISTER write (continuous)
REGISTER status/data
OP
...
MOSI
0xF5
OP
MISO
0x8A
0xCF
0xAD
8 cycles
Table 10: SPI Instructions / OPCODES
Figure 6: Setting ACTIVATE: RACTIVE/PACTIVE
(several slaves)
SPI data transmission takes place as follows:
(Figure 5):
Bytes FAIL, VALID, BUSY, and DISMISS in the STA-
TUS byte are reset by the ACTIVATE command (Table
14).
1. The master initializes a transmission on a rising
edge at CS.
RACTIVE
2. iC-LNB transfers the level from MOSI to MISO.
Code
Description
0
1
Register communication deactivated
Register communication activated
3. The master transmits the OPCODE and address
ADR through MOSI; iC-LNB immediately outputs
OPCODE and ADR through MISO.
Table 11: Register com. activation
4. iC-LNB transmits the data requested according
to the address.
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.
5. The master ends the command with a falling
edge at CS.
6. iC-LNB switches its MISO output to 1.