3 Serial Communications
These devices can use either SPI or UART communications
modes; it cannot use both at the same time. The mode
selected depends on which mode is used first to
communicate with the part.
The host device always initiates communications sequences;
the QT is incapable of chattering data back to the host. This is
intentional for FMEA purposes so that the host always has
total control over the communications with the QT60xx6.
A command from the host always ends in a response of some
kind from the QT. Some transmission types from the host or
the QT employ a CRC check byte to provide for robust
communications.
A DRDY line is provided that handshakes transmissions.
Generally this is needed by the host from the QT to ensure
that transmissions are not sent when the QT is busy or has
not yet processed a prior command. In UART mode this line
is bi-directional, and the QT can use it to suspend
transmissions back to the host if the host is busy.
3.1 DRDY Line
Serial communications is controlled by the DRDY line, which
is an output from the QT60xx6 to the host. When DRDY is
high, the host is permitted to send data. This works in both
UART and SPI modes. After a byte is received DRDY will
always go low even if only for a few microseconds; during this
period the host should not send data. Therefore, after each
byte transmission the host should first check that DRDY is
high again.
The host should sequence transmissions as follows:
1. Check to see if DRDY is high; if not, wait
2. If DRDY is high: send a byte to QT
3. Wait 100µs or longer (time T2)
4. Wait until DRDY is high (it may already be high)
5. Send next command or null byte to QT
DRDY is an open-drain output which must be pulled high by
an external resistor, from 10K ~ 50K ohms in either UART or
SPI mode.
3.2 SPI Communications
SPI mode is selected if the host sends data over the SPI lines
first. There is no other configuration required to make the
device operate in SPI mode. Once SPI is selected after a
powerup, the device cannot switch to UART mode unless the
device is reset.
SPI communications operates in slave mode only, and obeys
DRDY control signaling. The clocking is as follows:
Clock idle: High
Clock shift out edge: Falling
Clock data in edge: Rising
Max clock rate: 4MHz
SPI mode requires 5 signals to operate:
MOSI - Master out / Slave in data pin; used as an input for
data from
the host (master). This pin should be connected
to the MOSI (DO) pin of the host device.
MISO - Master in / Slave out data pin; used as an output for
data to
the host. This pin should be connected to the MISO
(DI) pin of the host.
SCK - SPI clock - input only clock pin from host. The host
must shift out data on the falling edge of SCK; the QT60xx6
clocks data in on the rising edge of SCK. The QT60xx6
likewise shifts data out on the rising edge back to the host.
Important note: SCK must idle high; SCK should never
float.
/SS - Slave select - input only; acts as a framing signal to the
sensor from the host. /SS must be low before and during
reception of data from the host. It must not go high again
until the SCK line has returned high; /SS must idle high.
DRDY - Data Ready - active-high - indicates to the host that
the QT is ready to send or receive data. This pin idles high.
DRDY should be pulled high with a 10K to 100K pullup
resistor. In SPI mode this pin is an output only.
lQ
6 QT60486-AS 0.07/1103
Advanced information; subject to change
Figure 3-2 SPI Slave-Only Mode Timing
Twcrdy
high via pullup-R
DRDY from QT
T1 T2
/SS from host
CLK from Host
Host Data Output
(Slave Input - MOSI)
QT Data Output 3-state 3-state
(Slave Out - MISO)
32107654
4321? 765
076
? 43
543
?765 67210 ? 450123
1210 452367 0
T3
Tcyc
T4
Data shifts out on falling edge
data response
optional 2nd command byte null byte to get QT response
Data shifts in on rising edge
command byte
Figure 3-1 SPI Connections
MOSI MOSI
MISOMISO
SCK SCK
DRDY
P_OUT
P_IN
SS
Host MCU QT60xx6
10K