![4D systems gen4-HMI Series Datasheet Download Page 12](http://html1.mh-extra.com/html/4d-systems/gen4-hmi-series/gen4-hmi-series_datasheet_3118545012.webp)
gen4-HMI Display Modules
gen4-uLCD-50D Page 12 of 29 www.4dsystems.com.au
Where ‘pin’ is the GPIO pin compatible with this
particular function, ‘mode’ is the type of trigger used
to count on such as Rising/Falling/Edge, and
‘OVFfunction’ is the user function to call when the
counter overflows, if desired.
Please refer to the separate document titled
'DIABLO16-4DGL-Internal-Functions.pdf'
for more
information on how to use the Pin Counter functions,
along with the separate document titled
‘DIABLO16-
Processor-Datasheet-REVx.x.pdf’
.
4.10.
Quadrature In
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).
Please refer to the separate document titled
'DIABLO16-4DGL-Internal-Functions.pdf'
for more
information on how to use the Quadrature Input
functions, along with the separate document titled
‘DIABLO16-Processor-Datasheet-REVx.x.pdf’
.
4.11.
Analog Inputs
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.
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 for
the 4 channels, and ‘func’ is the user function to call
when the number of samples specified have been
collected.
Please refer to the separate document titled
'DIABLO16-4DGL-Internal-Functions.pdf'
for more
information on the Analog Input functions, along with
the separate document titled
‘DIABLO16- Processor-
Datasheet-REVx.x.pdf’
.
Note: Analog Inputs are 0-3.3V tolerant only. Do not
apply voltages outside of this range as you will
damage Diablo16.