iC-LNG 16-BIT OPTO ENCODER
WITH SPI AND SERIAL / PARALLEL OUTPUTS
Rev A1, Page 16/25
REQ
PACTIVE
CS
Code
Description
0
1
Sensor data channel deactivated
Sensor data channel activated
SCLK
MOSI
MISO
OP
Table 12: Sensor data via SPI
OP
SD1
SD2
...
8 cycles
If PACTIVE is not set, on commands Sensor data sta-
tus or Sensor data transmission the ERROR bit is
set in the 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.
Figure 7: SDAD transmission: read SD
With command Sensor data transmission the master
can not only read sensor data (SD) out from the slave;
at the same time it can also transmit actuator data (AD)
to the slave. iC-LNG ignores the transmitted actuator
data.
If only one slave is connected up with one register and
one sensor data channel, it must be ensured that the
RACTIVE and PACTIVE bits are last in the data byte
(Figure 6).
REQ
CS
SCLK
NB:
OP
OP
AD1
SD1
AD2
SD2
...
...
MOSI
MISO
If the slaves are connected in a chain (full duplex
chain), with this command the master can determine
the number of connected register and sensor data
channels. To this end it can send a 1 after the opcode,
which is repeated at MISO after the number of register
and sensor data channels (Figure 6).
8 cycles
Figure 8: SDAD transmission: read SD, write AD
Sensor data status
CS
SCLK
Should the master not know the processing time, it can
request sensor data using the command Sensor data
status. iC-LNG does not need any processing time;
therefore, SVALID is always valid.
1
0
0
0
0
1
0
0
0
0
0
0
RA PA
OP
OP
MOSI
MISO
0
0
8 cycles
RACTIVE / PACTIVE vector
The command causes
Figure 6: Setting ACTIVATE: RACTIVE/PACTIVE
(one slave)
1. all slaves activated with PACTIVE to switch their
SVALID register between MOSI and MISO.
Sensor data transmission
iC-LNG samples its position data on the first rising
edge at SCLK if CS is switched to 1 (REQ). The sensor
data shift register is looped-in between signals MOSI
and MISO for SPI communication and can then be
clocked out. The size of the sensor data shift regis-
ter must be set to 16 bits (cf. section on shift register
output, page 21).
2. The next request for sensor data, triggered on
the first rising edge at SCLK when CS has again
been set to 1, is ignored by the slave.
The end of conversion is signaled by SVALID (SV).
If invalid data is sampled in the shift register, the ER- With this command the master can poll to the end of
ROR bit is set in the STATUS byte (Table 14) and ze- conversion. The sensor data is readout on the com-
roes are output as the data word.
mand Sensor data transmission.