Datasheet

4D SYSTEMS DIABLO16 Processor
© 2014 4D SYSTEMS Page 18 of 33 www.4dsystems.com.au
DIABLO16 PROCESSOR
Quadrature In 5.14.
There are two Quadrature Input channels available
on the DIABLO16 processor, which requires 2 GPIO
pins each.
Please refer to the table on the previous page for
details on which GPIO can be configured for
Quadrature Input.
Quadrature Input allows a quadrature encoder to
be connected, and the position counter and delta
counter can be read at any time.
To enable the Quadrature Input function on a set
of GPIO pins (2 pins required), the following 4DGL
function is used:
Qencoderx(PHApin, PHBpin, mode);
Where Qencoderx is substituted for Quencoder1
or Quencoder2 accordingly, ‘PHApin’ is the pin
connected to the A Phase of the Encoder, ‘PHBpin’
is the pin connected to the B Phase of the Encoder,
and ‘mode’ is not currently used so is to be set to
zero (0).
Example Connection Diagram
This illustrates Quadrature input being configured
on GPIO PA2 and PA3, and is used to read pulses
from a quadrature encoder.
Note: This example is an illustration of a
quadrature input connection to the Diablo16
processor. It is not the complete circuit nor
illustrates best practice.
Please refer to the separate document titled
'DIABLO16-4DGL-Internal-Functions.pdf' for more
information on how to use the Quadrature Input
functions.
Analog Inputs 5.15.
Please refer to the table in section 5.6 for details
on which GPIO can be configured to be analog
inputs.
The analog inputs on the DIABLO16 have a range
of 0 to 3.3V, each with a max resolution of 12-bits.
The analog inputs can be read using three modes,
standard mode, averaged mode or high speed
mode.
Standard Mode results in a sample being
immediately read. Standard Mode can read over
40000 values per second. Operates at 12-bit.
Averaged Mode results in a 16 sample being
immediately read and their average returned.
Averaged Mode can read approximately 20000
values per second. Operates at 12-bit.
Highspeed Mode collects a user specified number
of samples at a user specified rate/frequency and
can execute a user function when complete. The
updated value updates approximately 250000
times across 1-4 channels. Operates at 10-bit.
Note: The various analog modes can interfere
with the operation of the touch screen if their
functions are called too frequently. It is
recommended to limit the calls of the analog
functions to a maximum of once every
millisecond. Please refer to the Internal Functions
documentation for further information on this
topic. Not relevant if an external touch IC (or no
touch) is used.
To enable a GPIO to be used as an Analog Input for
Standard or Averaged modes, the following 4DGL
function is used to set the pin:
pin_Set(mode, pin);
Where ‘mode’ is the desired mode defined above,
either Standard or Averaged, and ‘pin’ is the GPIO
compatible with this function which is to become
an Analog Input.
For highspeed mode, the following 4DGL function
is used to set the pin and define the parameters:
ana_HS(rate, samples, 1buf, 2buf, 3buf, 4buf, func);
Where ‘rate’ is the number of samples per second,
‘samples’ is the number of samples to collect per
channel, ‘1buf’ ‘4buf’ are the buffer addresses