Download Print this page

Parallax TSL1401-DB Instructions Manual page 29

Linescan camera module

Advertisement

Here is a chart that shows how each binary acquisition mode might be used:
Threshold
Comparison
Fixed
Level
Fixed
Window
Floating
Level
Floating
Level
Floating
Window
Here's a statement that sets Threshold to 30, Hysteresis to 10, and uses a floating threshold with level
comparison and a filter value of 5:
OWOUT owio, 0, [SETBIN, 30, 10, FLOAT|LEVEL|5]
The constants SETBIN, FLOAT, and LEVEL are defined for you in the code template near the end of
this section. Instead of FLOAT, you could also choose FIXED; and instead of LEVEL, WINDOW, which
are also predefined.
Setting the LED
If you are using the StrobeLED-DBM mezzanine board (forthcoming), you can set the duration and/or
brightness of the LED flashes as shown here. The basic format for this command is:
Where SETLED is a constant equal to $EB (mnemonic "enter brightness"), and Amount has the
following format:
Bit 7
Bit 6
0: Intensity
LED brightness value (0 – 127), equivalent to 0 – 50% for duration of exposure.
1: Time
LED "on" (strobe) time (0 – 127), equivalent to 0 – 3.4mS at 100% brightness.
Once the SETLED command has been issued, it stays in effect until reissued. When the lower seven bits
of Amount are zero, the LED is effectively turned off. Otherwise, it is turned on at the beginning of each
exposure. If bit 7 of Amount is zero, it remains on for the entire integration time at a level selected by
the lower seven bits. If bit 7 is one, it strobes on at 100% brightness for the duration specified by the
lower seven bits. This time is approximate and is governed by the AVR's internal RC clock. So it will vary
somewhat with temperature.
Here's some sample code that causes the LED to strobe for about 1mS at the beginning of each
exposure:
OWOUT owio, 0, [SETLED, TIME|75]
TIME is a constant defined in the code template that equals $80. In its place, the constant INTEN may
be used. It's equal to zero and does nothing, but it makes the code more readable.
© Bueno Systems, Inc. • TSL1401-DB (2009.10.01)
Filter
Looking for objects and edges when lighting is even.
Looking for intensity excursions outside a certain band.
5-7
Looking for objects and edges when lighting is uneven.
2-4
Edge location among widely varying pixel values
0-1
Looking for texture, whose minimum intensity is determined by
Hysteresis. Set Threshold to 0.
SETLED, Amount
Bit 5
Bit 4
Application
Bit 3
Bit 2
Bit 1
Bit 0
Page 29 of 52

Advertisement

loading