User Guide
TMG3992 EVM and TMG3993 EVM
TMG3992/3
Gesture, Color, ALS, and Proximity Sensor Module with mobeam™ Barcode
Emulation Evaluation Kit
Version 1.2
Contents
1
Establishing basic functionality ............................................................................................ 5
2
TMG3992/3 EVM graphical user interface (GUI) ................................................................. 6
2.1
Software Overview ............................................................................................................... 6
2.1.1
Input side, “Functional” tab .................................................................................................. 9
2.1.2
Input Side “Register” Tab ................................................................................................... 11
2.1.3
Output side, “Register” tab ................................................................................................. 17
2.1.4
Output side, “Functional” tab .............................................................................................. 20
2.1.5
Output side, “PLOT” tab ..................................................................................................... 20
2.1.6
Output “GPlot” Tab ............................................................................................................. 21
2.1.7
Output “NSEW” Tab ........................................................................................................... 21
2.1.8
IRBeam (mobeam) Operation ............................................................................................ 21
page 2/24
TMG3992/3
The device features advanced Gesture detection, Proximity detection, Ambient Light Sense (ALS),
Color Sense (RGBC), and optical pattern generation/transmission for IR broadcast. The modular
2.36mm x 3.95mm x 1.36mm package (TMG3993) is drop-in compatible with existing modular
footprints and incorporates an IR LED and factory calibrated LED driver. The slim modular package,
2.0mm x 3.95mm x 1.36mm (TMG3992) also incorporates an IR LED and factory calibrated LED
driver and is pin compatible with the larger modular package.
TMG3992/3 will be used to represent TMG3992 and TMG3993. TMG399x will be used to represent
TMG3992 or TMG3993 throughout this document.
Gesture detection utilizes four directional photodiodes to sense reflected IR energy (sourced by the
integrated LED) to convert physical motion information (i.e. velocity, direction and distance) to a
digital information. The architecture of the gesture engine features automatic activation (based on
Proximity engine results), ambient light subtraction, cross-talk cancelation, dual 8-bit data
2
converters, power saving inter-conversion delay, 32-dataset FIFO, and interrupt driven I C
communication.
Initial hardware setup
The TMG3992/3 EVM is USB plug and play friendly. Follow the instructions found in the Quick Start
Guide (QSG). This will load the graphical user interface (GUI) onto the target personal computer
along with user documentation. The GUI is only Microsoft windows compatible.
page 3/24
The EVM hardware kit consists of the EVM Controller and the TMG399x daughterboard, a USB
interface cable and USB Memory Stick.
When the USB cable is connected, the green LED should flash momentarily indicating that power is
being received via the USB interface. The amber LEDs should sequence indicating the controller
board processor is running. If the green LED does not flash, check the USB cable connections;
unplug the USB cable and try again. If the green LED still does not flash, check the PC for USB
error messages.
See the Resources section at the end of this document for additional assistance.
page 4/24
1
Establishing basic functionality
The software should be started using the desktop icon or by double clicking the
DigitalLightSensor.exe file from the installation directory. The default installation directory,
depending on the device and the operating system you are using, is:
C:\Program Files\ams\TMG399xEVM Windows 32 bit operating systems
C:\Program Files (x86)\ams\TMG399xEVM Windows 64 bit operating systems
When started, four windows will open on the PC. The top window is the Parent Window which
initializes USB and detects the optical device connected. This window can be placed out of the
way. The bottom window, or Child Window, is the main user interface and should be positioned on
the screen for easy access. Two other windows open to the right of the parent window. One
displays any gesture (E.g. North, South, East, or West) and the other logs information that pertains
to each gesture that is processed. Please refer to the figures below.
To close the GUI, click on the “X” in the Parent Window. Closing any of the other windows will not
completely terminate the application.
The “Functional” tab on the left and “Gesture” tab on the right side of the child window main display
will be selected by default.
page 5/24
The balance of this document identifies and describes the controls available on the different tabs of
the GUI. In combination with the TMG3992/3 datasheet, the quick start guide, and application notes
available on the ams website, www.ams.com, there should be enough information to allow
evaluation of the TMG3992/3 device.
2
TMG3992/3 EVM graphical user interface (GUI)
2.1
Software Overview
On initialization the software displays three windows – a smaller “Digital Light Sensor” window (the
Parent Window), a larger window (the Child Window) containing controls pertinent to the device
connected and a third window (the Gesture Window) showing any gesture vectors detected.
If “No Devices” appears, verify that the daughterboard is connected to the motherboard properly. If
“No_HID” appears, verify the USB cable is connected. A green LED on the EVM Controller 2.1a will
flash to indicate that the USB cable is connected and providing power to the system. The “Reset”
button in this window can be pressed, or the software can be restarted, to reinitialize the system.
The larger window, Child Window (CW), contains the user interface with control buttons, fields,
selection boxes and output values for the device connected. Tabs are used to make control and
evaluation of specific device functions easy. For the TMG3992/3 sensor the initial display screen is
shown:
page 6/24
This window has inputs organized on the left, and outputs organized on the right. Values for register
variables may be set using multiple techniques. The Functional tab is commonly used to quickly
evaluate the device with nominal settings. The Input Register tab allows the register settings to be
changed, and the Output Register tab allows registers to be viewed. Other tabs provide additional
demonstration and test features for evaluation.
The tabs that are displayed correspond to the different functional parts of the device. Since the
TMG3992/3 IRBeam and Gesture functionality are controlled by a common address space, it is
necessary for the GUI to keep track of which functional mode is currently being evaluated.
By default, the GUI is set for ALS/PROX/Gesture memory space/mode. While in this mode,
IRBeam cannot be evaluated because the shared device memory space is controlling gesture
functions. If IRBeam is to be evaluated, then the user must select IRBeam from the “System” menu
as shown above. It is possible to switch between IRBeam and ALS/Prox/Gesture, but care must be
taken to manually set (reset) the “Enable” bits (address 0x80) each time a switch is made.
page 7/24
Always visible along the bottom are the following controls:
A section containing logging controls and sampling status information:
1. Text entered here is appended to the default file name and stored in the log file. The file name
contains the Part Name and address shown in the large “Digital Light Sensor” window, the
child window, an underscore “_” and the text entered. The default if nothing is entered is a
period (“.”).
2. Secondary comment box. Text entered here is also appended to the log file name and
stored in the log. The default if nothing is entered is a period (“.”).
page 8/24
Sample:
TMG39931Bx39 _ A-B-C _ 1-2-3 _ Log.csv
From DigitalLightSensor.exe
From User Input
3. The start button tells the program to start logging. The fields entered in #2 and #3 will be
used as field names in the output. If you change the values in #2 or #3, the corresponding
field names will change in the output beginning at the time of the change. The default log
file name will be based on the values in #2 and #3 at the time the log file is written.
4. Clear –The Clear button will flush the previous optical sample readings and reset the
elapsed time indicator (see #7).
5. Log – Creates a comma-separated values file containing the log data. The name will be
assigned as explained in #3. This will cause the system to write out any data currently in
the log buffer.
6. Count of samples in the log buffer. When that number reaches the limit selected in #9, the
system will show a file dialog to save the log in a named file.
7. The elapsed time since the beginning of logging data.
8. The number of log samples collected before log entry is written to the log file.
2.1.1 Input side, “Functional” tab
Simple commonly used controls exist for the ALS functionality, the proximity detection functionality,
the wait time between samples, and the proximity threshold level.
The Input Functional Tab is enabled with the Gesture Mode checked by default. This allows the
user to adjust several key Gesture parameters.
Gesture FIFO length to 1, 4, 8, or 16
Gesture LED Drive to 12.5%, 25%, 50% and 100%
Gesture Pulse Length to 4µs, 8µs, 16µs, or 32µs.
LED Boost of 100%, 150%, 200% and 300%
page 9/24
Number of Gesture Pulses of 1, 2, 4, 8, 16, 32 or 64 pulses.
If the Gesture Mode box is not checked, the upper half of the box is made visible to that the ALS
Sensor and Proximity Sensor controls may be accessed. These allow optimization of ALS and
Proximity sensing.
ALS Sensor
Gain - The gain control allows the user access to the GAIN settings of the ADC signal to increase
sensitivity. The gain options include 1x, 4x, 16x and 64x and are selected from the list box when the
down arrow is depressed
Time (mS) – This list box has numerous preselected values for the integration time from 2.78mS to
712mS with a default of 50.04mS. If a value other than what is shown in the list box is desired it
must be entered manually using the Register Tab, ALS Sub Tab (documented later). Manually
entering a value will NOT work in this location. The actual integration time is shown on the line
below.
Proximity Sensor
The control fields to vary the proximity sensor threshold settings are found in this section. These
controls allow setting the release and detect threshold for Proximity detection. Both controls allow
register settings from 00 to 255.
Avg Len – Specifies the number of samples that are averaged together to determine that a
proximity event was detected.
Set stdev allows the user to set the number of standard deviations after which the proximity
detection will occur when a value is outside the threshold limits. This provides hysteresis or
“persistence” of the reading.
page 10/24
2.1.2 Input Side “Register” Tab
The input “Register” Tab has six sub tabs that allow setting values for most functions of the
TMG3992/3.
Control Sub Tab
The Control has 15 check boxes which enable/disable individual bits to control operation of the
TMG3992/3 in various operating modes.
ENABLE
1. PBEN – Enables the IRBeam™ functionality. IRBeam allows the user’s phone to
be used by barcode scanners as if it was a paper barcode
2. GEN – Gesture Detection Enable. Checking the GEN box enables detection of a
Gesture movement and generating an interrupt if GEIN is enabled.
3. SAI – Stop After Interrupt. Writing a one (0x01) causes the device to power down at
the end of the ALS cycle when an interrupt has been generated.
4. WEN – Wait Enable. Writing a one (1) activates the wait timer.
5. PEN – Proximity Enable. Writing a one (1) enables the proximity detection.
6. AEN – ALS Enable. Writing a one (1) enables the ALS
7. PON – Power on. Activates internal oscillator. When PON=0 device is in standby.
INTERRUPT
1. PBEN – IR Beam Interrupt Enable. Enables interrupt generation when an IR Beam
Event occurs. Setting this check box enables this interrupt.
2. GEIN – Gesture Interrupt Enable. Checking this box allows an interrupt to be
generated when a Gesture movement occurs.
3. PIEN – Proximity Interrupt Enable. Writing a one (0x01) enables the Proximity
interrupt.
4. AIEN – ALS Interrupt Enable. Writing a one (0x01) enables the ALS interrupt.
page 11/24
5. CPSIEN – Color Photodiode Saturation Interrupt Enable being checked will cause
an interrupt when the Color Photodiode saturates.
CONFIG1
1. WLONG – Wait Long Enable causes the wait time to be multiplied by 12x when
checked.
2. GMODE – Gesture State Machine Active will enable Gesture processing when
checked.
“ALS” Sub Tab
The ALS tab shows the registers associated with ambient light sensing control. Register values in
hex are shown on the left, preselected values are available in list boxes in the middle, and actual
values are shown on the right.
WTIME Register (0x83) sets the time between PROX and ALS cycles. This value, shown
to the right of the box, varies from 2.72mS to 711.68mS by setting a value from 0xFF to
0x00.
ATIME Register (0x81) controls the ALS integration time. The actual time is:
(256-ATIME) * 2.72 mS
Note: The column on the right is the computed value for ATIME and is always correct.
Sometimes the value shown in the list box will be one of the preselected values but it has
not been selected. If this happens the number will not be the same as the computed
number for WTIME on the Control Sub-Tab. The computed value is the one that is correct.
This can be fixed by selecting a preselected value from the list box or by cycling the register
value UP/DOWN or DOWN/UP. This will set the list box value or clear the value from the list
box so the screen is correct.
AGAIN Register (0x8F) adjusts the ALS input gain. Valid values are 1x, 4x, 16x, and 64x.
page 12/24
“Prox” Sub Tab
The Prox Sub tab shows registers associated with proximity sensing control. Counts and length are
shown on the left, the middle section contains controls for offset, and the column on the right
displays the gain values. Two drop-down controls allow adjustment of the sink current and number
of LED pulses, and selection of the photodiode mask are used to detect the reflected energy. The
first list box allows rapid selection of LED sink current and the number of LED pulses. Clicking the
down arrow brings up a list box with several predefined combinations:
Note: Due to the automatic nature of the gesture algorithm, values entered in the registers and list
boxes may not automatically update each other, so the values displayed may not match. The
computed values on the right are always correct and show the values currently in use.
COUNT/LENGTH
PPLEN (0x8E:7,,6) define the length of the Proximity IR LED Pulses. These can be set to
4µS, 8µS, 16µS or 32µS.
PPULSE (0x8E:5..0) - This control allows the user to select the number of LED pulses for
proximity detection. These may be set from zero (0x00) to 64 (0x3F) pulses.
OFFSET
OFFSET – shifts the data positive in a North East direction (NE) or a South West direction
(SW) from 0 to 127 (0x00 to 0xFF) counts.
PGAIN
PGAIN – Sets the gain of the Proximity sensors to 1x, 2x, 4x or 8x.
PCMP – sets Prox Gain Compression to 2x when only one diode is in use.
LED
LDRIVE – sets the sink LED drive current to 12.5%, 25%, 50% and 100%.
LEDBOOST – boosts LED drive current 100%, 150%, 200% or 300%.
MASK
PMSK_N – Prox Mask North enables and disables the North diode.
page 13/24
PMSK_S– Prox Mask South enables and disables the South diode.
PMSK_W– Prox Mask West enables and disables the West diode.
PMSK_E– Prox Mask East enables and disables the East diode
“Threshold” Sub Tab
This tab contains the settings for controlling the generation of ALS and Prox interrupts to a control
processor.
ALS Threshold
The LOW and HIGH values are 16 bit thresholds for the upper and lower trigger points. Each is set
using 1 16-bit control. Another control APERS establishes the required persistence of the interrupt
signal. APERS values control from zero to 60 samples for a persistence value.
page 14/24
Prox Threshold
The LOW and HIGH values are 8-bit thresholds for the upper and lower trigger points. Each is set
using one 8-bit register. Another control PPERS establishes the required persistence of the interrupt
signal. PPERS values range from 0 to 15 samples for a persistence value.
“RAM” Sub Tab
The RAM Sub Tab allows reading of the internal RAM Memory of the TMG3992/3 for test and
debug. Clicking the “READ RAM” button performs the memory read. Clicking the “WRITE RAM”
button performs the memory write. Clicking the “CLEAR RAM” button sets all RAM to zero.
“Gesture“Tab
The Gesture Tab allows the user to set various timings and parameters to optimize gesture sensing
in the user’s environment.
GPENTH – Gesture Prox Entry Threshold sets the PDATA value which starts the Gesture
State Machine. GPENTH can be set from 0 through 255.
GEXTH – Gesture Exit Threshold sets the sum of the photodiodes which trigger exit of the
Gesture State Machine. GEXTH can be set from 0 through 255.
page 15/24
GFIFOTH – Gesture FIFO Threshold sets the number of times the gesture is detected
before GINT is triggered. GFIFOTH can be set to 1, 4, 8 or 16.
GEXPERS – Gesture Exit Persistence sets the number of Gesture Exits required before the
gesture will exit. GEXPERS can be set to 1, 2, 4, or 7 counts.
GGAIN – Gesture Gain Control allows setting of the gain of the gesture detection. GGAIN
can be set to 1, 2, 4 or 8.
GWTIME – Gesture Wait Time controls how long to wait before a gesture can be detected.
GWTIME can be set from 000 through 111 in 2.8mS increments up to a total of 39.2mS.
GDMS – Gesture Dimension Select sets which or how many of the four or eight dimensions
are being used to detect that a gesture has occurred.
page 16/24
OFFSET
1. N: North Offset in 0 to 127 counts
2. S: South Offset in 0 to 127 counts
3. W: West Offset in 0 to 127 counts
4. E: East Offset in 0 to 127 counts
Save will store the offsets previously entered into memory.
GEXTMSK
N: Masks the North Photodiode out of the exit sum for exiting the gesture state
machine.
S: Masks the South Photodiode out of the exit sum for exiting the gesture state
machine.
W: Masks the West Photodiode out of the exit sum for exiting the gesture state
machine.
E: Masks the East Photodiode out of the exit sum for exiting the gesture state machine.
LEDBOOST will increase the LED Current 100%, 150%, 200% or 300%.
GPLEN sets the Gesture Pulse Length to 4µS, 8µS, 16µS or 32µS.
GLDRIVE sets the Gesture LED Drive current to 12.5mA, 25mA, 50mA or 100mA.
GPULSE sets Gesture Pulse Count from 1 to 16 pulses (0x00 to 0x0F).
GMODE enables the Gesture State Machine when checked.
2.1.3 Output side, “Register” tab
The value of internal registers are displayed on this tab. Register values cannot be set here. To set
registers use the Register tab on the input side of the screen. The CDATA, RDATA, GDATA and
BDATA values are the ADC values for the photodiodes and the proximity detection value. Each is
read via 8-bit registers.
page 17/24
page 18/24
Flags
These boxes show the state of various interrupts, flags and other bits.
CPSAT – Clear Photodiode Saturated
PSAT – Proximity Saturated
PINT – Proximity Interrupt
AINT – ALS Interrupt
GINT – Gesture Interrupt
PVALID – Proximity Valid
AVALID – ALS Valid
PBINT – IR Beam Interrupt
PBUSY – Interrupt Busy
GFOV – Gesture FIFO Over Flow
GVALID – Gesture Valid
PROX
PDATA – Shows the current Prox Count
Color
CDATA
1. CDATA – Clear photodiode ADC data, 8-bit value.
RDATA
1. RDATA – Red photodiode ADC data, 8-bit value.
GDATA
2. GDATA – Green photodiode ADC data, 8-bit value.
BDATA
3. BDATAL – Blue photodiode ADC data, 8-bit value.
Clear Interrupts
These buttons clear or set an interrupt.
1. IIClear – Clears the IRBeam Interrupt
2. IForce – Forces an IRBeam Interrupt
3. PIClear – Clears a Packet Interrupt
4. CIClear – Clears a Symbol Interrupt
5. AIClear –Clears all Interrupts
6. GlClear – Clears a Gesture Interrupt
page 19/24
2.1.4 Output side, “Functional” tab
The Proximity indication shows the current reading (Raw Prox Count), a rolling average (ProxAvg),
and the standard deviation of the rolling samples. The number of samples is specified on the Input
Side, “Functional” tab.
The “Prox Detect” box is a visual indicator of proximity detection, based on the Release and Detect
settings on the Input Side “Functional” tab.
The Clear and Color photodiodes output values are shown, and their ratio is shown below.
When in the Gesture Mode, the GESTURE box will show values for the RGB and Clear for each
direction photodiode and the sum NSEW value.
2.1.5 Output side, “PLOT” tab
The Clear and RGB photodiodes and the Prox reading can be displayed vs. time on the graph. The
plot shows proximity events happening and all outputs for a static system. Multipliers (selected from
the list boxes) may be used to scale the display accordingly.
page 20/24
2.1.6 Output “GPlot” Tab
The GPlot is a graphical display of the Gesture diodes along with their magnitude and differences.
2.1.7 Output “NSEW” Tab
The Output NSEW tab shows the raw NSEW data from the photodiodes as well as the Standard
Deviation of the various diode readings.
2.1.8 IRBeam (mobeam) Operation
Once IRBeam operation is selected in the “System” menu, two new tabs become visible on the
Input and Output sides of the GUI as shown below.
page 21/24
The Barcode tab allows direct control of IRBeam registers in one convenient location. As the
trackbars are modified, the register values are displayed in the upper right corner. Below the
trackbars, the parameter timing is displayed. The Timing tab (right side) depicts a graphical
representation of IRBeam timing associated with the barcode transmission. The “Reset to Defaults”
button preloads the IRBeam registers with values known to work with many barcode scanners,
including the Symbol LS2208. The “RUN” button initiates a barcode pattern burst. The barcode
pattern is generated and displayed in the Pattern tab.
The GUI can also receive data from two types of barcode scanners: the Symbol LS2208 (Serial
emulation) or a generic “HID Keyboard” scanner.
If an LS2208 (Serial emulation) scanner is used, then “Serial Port Over USB” must be selected and
the appropriate COM port must also be selected in the “COMxx” dropdown box. Note that a USB
driver must be installed for Windows OS to recognize the scanner.
Any barcode that is received by the scanner will be displayed I the “DIGITS” textbox. Note that if a
HID keyboard scanner is used, then the textbox must be in focus (I.e. mouse clicked, cursor
blinking in the “Digits” textbox). On startup, the success indicator displays “NO SCANNER” and is
grey in color. If the received barcode matches the barcode that was generated by the software, in
the pattern tab, then the success indicator will change color from grey to green, otherwise it will
change color to red.
The “HOP Table” tab functions to sequentially transmit the same barcode pattern with different
settings for timing. This functions similarly to the mobeam driver implementation of barcode
transmission. This is done to improve the likelihood that a barcode will be received successfully by
most any scanner, independent of its scan rate. The values in the hop table are editable, and the
barcode pattern can be sourced by the RAM tab or the barcode loaded in the Pattern tab. The
page 22/24
“HOPS” textbox sets the number of iterations that the entire hop table will be burst. If HOPS = 0
and RUN button is clicked, then barcode transmission is immediately terminated. If HOPS = 255,
and the RUN button is clicked, then the hop table will continuously burst. Any number of HOPS
between 1 and 254 will cause that number of hop table iterations.
The Pattern tab specifies the barcode to be burst. Two barcode protocols are available: UPC-A and
CODE-39. UPC-A is always 12 digits long, but CODE-39 can be any length up to 55 characters.
The code length is selectable. Users can uncheck the Auto-generate checkbox and manually input
a barcode into the DIGITS textbox, or, left checked, the GUI will automatically generate a new
barcode and display in before transmission by the device. The “RUN” button initiates the barcode
transmission.
The Validate Scanner tab provides another device interface similar to the Hop table tab, except that
the hop table setting have been preselected by mobeam and are hardcoded into the GUI. Control
of LED intensity and number of hop table iterations textbox function as previously described in the
Hop Table tab.
IRBeam tabs also contain a blue question mark button on most tabs. These buttons open an
informational window that briefly explains how to use the functions on the tab. Also, users may
hover the mouse pointer over a control causing a tool-tip to appear which describes the control/and
the associated device function.
page 23/24
Conclusion
The inclusion of IRBeam into mobile applications provides System Designers an easy and cost
effective solution to meet expectations set by consumers of electronics devices, cell phones in
particular. IRBeam technology works reliably to "beam" barcode data to the multitude of the world's
GS1 standard point-of-sale scanners.
References
1. Roger C. Palmer, The Bar Code Book, Trafford Publishing, 2007
2. Symbol LS2208 Product Reference Guide, April 2012
3. TCS3390 Datasheet, ams AG
Resources
TMG3992/3 datasheet
TMG3992/3 EVM Quick Start Guide (QSG)
Designer’s Notebooks
For additional information regarding the TMG3992 and TMG3993, please refer to the datasheet. For
information regarding the installation of the Gesture EVM host application software please refer to
the TMG3992/3 EVM Quick Start Guide.
Designer’s Notebooks dealing with various aspects of optical measurement and optical
measurement applications are available. All content is available on the ams website
www.ams.com.
page 24/24