Baud rate
Data length
Parity
Stop bits
Host command space, Tcm
Response delay to host, Tdr1
9,600 - 57,600
8 bits
None
1
m
50μs
Table 4-1,
also, Sec. 6
10μs to 2ms
Multi-byte return spacing, Tdr3
The actual baud rate is determined by Setup ^Q (page 25).
A UART command may consist of one or two bytes with a
m
50us delay between command bytes. At the end of a full
command, the host must await a response from the sensor.
The sensor may take some time to process the host
command and respond. When it does so, it sends back its
data. For multi-byte responses, the bytes will be sent at
intervals which may be somewhat irregular depending on the
request and the processing load of the sensor. The host must
be prepared to accept the sensor data as it comes or there
can be a data overrun in the host.
If the data returns
too quickly for the host to accept it, the baud rate
should be lowered
.
A typical UART communication sequence is as follows
:
1) Host sends a byte to the sensor.
2) For 2-byte functions, a
m
50us delay is inserted by
the host and then the second byte is sent.
3) If the sensor has a command echo or data to send
back, it does so. The delay from step 2 to step 3 is
shown in Table 4-1. The delay between successive
response bytes (if they occur) is parameter Tdr3
noted above.
4) The sensor repeats (3) as necessary for multiple
byte responses.
5) The sensor waits for the next command.
The host should wait for
>
1ms after a sequence before
initiating another transmission sequence to be sure
that the sensor has completed any residual activities
from the prior command. Commands that are sent to
the host prematurely will be ignored.
4.6 Sensor Echo and Data Response
The devices respond to each and every valid
command from the host with at least one return byte.
In the case of functions that do not send data back to
the host, the part returns the command itself as an
echo, but only after the function has been processed to
completion; this also holds for 2-byte functions where
the second byte is an operand
:
in these cases the
return byte is an echo of the command, not the
operand.
One important exception to this is the recalibration
command
‘
b
’
which returns an acknowledgment
immediately rather than prior to the actual
recalibration.
Commands that return data do not send back a
command echo. If desired, the command byte can be
verified via the 'l' (lowercase L) function; see page 25.
The host should not transmit a new command until the
last command has been processed and responded to
completion, plus 1ms.
Commands that are not recognized are ignored, and the host
should monitor for timeouts to detect these conditions. If this
occurs a new command should not be sent until the specified
timeout condition has expired.
The maximum timings shown in Table 4-1 and Section 6-5
are guaranteed provided that the part is operating within its
burst timing limitations described in Section 5.7. If the burst
timing is in violation, the response time to a command may
take considerably longer.
4.7 Parallel Scan Port
The parallel port can be used to directly replace an electro-
mechanical or membrane keyboard. The port is electrically
equivalent to a 4x4 switch matrix with the exception that the
response to a host scan requires up to 100μs. The XS inputs
(pins 19..22) are active high; only one XS line should ever be
driven high at a time (except for error scan, noted below); the
Quantum Research Group Ltd.
l
Q
15
www.qprox.com QT60161B / R1.03
Figure 4-6 Filtering; SPI Slave-Only Connections
MOSI
MISO
SCK
DRDY
SS
QT60161 Circuit
Ra
220
47pF
Ra
Ra
Ra
Ra
RESET
1K
Host MCU
100
22pF
Yn
Xn
X drives
(1 of 4
shown)
Y Lines
(1 of 4
shown)
10K
+5
Ca
Ca
Ca
Ca
Ca
1nF
10K
+5
SCK
MISO
MOSI
(MS not
shown)
P_IN
P_OUT1
P_OUT2
Figure 4-7 Filtering; SPI Master-Slave Connections
MOSI
MISO
SCK
DRDY
SS
QT60161 Circuit
220
47pF
Ra
Ra
Ra
RESET
1K
Host MCU
100
22pF
Yn
Xn
X drives
(1 of 4
shown)
Y Lines
(1 of 4
shown)
Ca
Ca
Ca
Ca
1nF
10K
+5
MOSI
Ca
Ca
SS
SCK
MISO
(MS not
shown)
P_OUT
470pF
2,200
93.75kHz
270pF
1,000
187.5kHz
120pF
1,000
750kHz
47pF
680
3MHz
Ca
Ra
SPI Clock Rate
Recommended Values of Ra & Ca for Figures 4-6 and 4-7