MT9D115
www.onsemi.com
25
CONTROL FUNCTIONS
Sequencer: Camera Operating System
The sequencer is a finite state machine that controls the
general operations of the camera and switching between
operating modes. Camera operation is organized in states
such as enter preview, preview, leave preview, enter capture,
and capture. The sequencer carries out a number of
commands such as run, go preview, go capture, refresh, and
refresh mode. The current state of the sequencer is indicated
in a variable seqr.state. To execute a command, the user must
set a particular command number in the variable seqr.cmd.
ON Semiconductor recommends that the external host
monitor seqr.state to know when to change resolution or
capture frames.
Each state has its configuration; therefore, the user should
set up the state configuration to customize the camera
configuration before executing the corresponding program
such as GO TO CAPTURE. A typical camera operating
scenario is:
1. Configure mode variables after hardware reset.
2. Configure preview mode.
3. Execute sensor REFRESH program.
4. Run in preview until shutter button is pressed.
5. Capture a frame.
Figure 24. Sequencer Finite State Machine
PREVIEW
CAPTURE
INIT
CHG MODE
TO PREVIEW
ENTER
PREVIEW
LEAVE
PREVIEW
CHG MODE
TO CAPTURE
ENTER
CAPTURE
Go preview
Go capture
Go preview or
Go capture
STANDBY
Go preview
Go capture
Refresh mode
Refresh mode
Refresh
or Run
Refresh or Run
STANDBY
1
STANDBY
POR
0X0018[2] = 1
0X0018[2] = 0
STANDBY
NOTE: Any state except INIT can
transition to Standby state
by either hard standby or
soft standby.
LEAVE
CAPTURE
Mode: Context Information
The mode driver reduces integration efforts by managing
most aspects of switching the two contexts. It remembers
vital register values for each image acquisition context and
loads these values to the appropriate registers in the IFP
upon context switching.
For the mode driver variables to take effect, the user
changes the variable values in the mode driver (ID = 7).
Upon the next mode change or sequencers REFRESH
command, these driver variable values will be loaded to the
appropriate physical sensor core and IFP registers. The
image processing will take the new values at the beginning
of the next frame acquired.
To control the output image size, the user can modify the
mode driver variables such as output_width_A,
output_height_A, output_width_B, and output_height_B.
The mode driver will automatically apply any appropriate
downscaling filter to achieve this output image size as well
as update the watermark of the output FIFO. It is important
to set up the sensor core to output an image equal to or larger
than the crop window size, which in turn is equal to or larger
than the desired output image size.
MT9D115
www.onsemi.com
26
CAMERA FUNCTIONS
Simple Rule-based Auto Exposure
The AE algorithm performs automatic adjustments of the
image brightness by controlling exposure time and analog
gains of the sensor core as well as digital gains applied to the
image.
Auto exposure is implemented by a firmware (FW) driver
that analyzes image statistics collected by the exposure
measurement engine, makes a decision, and programs the
sensor core and color pipeline to achieve the desired
exposure. The measurement engine subdivides the image
into 16 windows organized as a 4 × 4 grid.
An AE algorithm mode is available: average brightness
tracking (ABT).
The ABT AE uses a constant average tracking algorithm
where a target brightness value is compared to a current
brightness value, and the gain and integration time are
adjusted accordingly to meet the target requirement.
AE Driver
DRT exposure mode is activated during preview. This
mode can also be enabled during video capture mode. The
DRT exposure mode relies on the statistics engine to track
speed and amplitude of the change of the overall luminance
in the selected windows of the image.
Backlight compensation is achieved by weighting the
luminance in the center of the image higher than the
luminance on the periphery. Other algorithm features
include the rejection of fast fluctuations in illumination
(time averaging), control of speed of response, and control
of the sensitivity to the small changes. While the default
settings are adequate in most situations, the user can
program target brightness, measurement window, and other
parameters.
The driver calculates image brightness based on average
luma values received from 16 programmable equal-size
rectangular windows forming a 4 × 4 grid. In preview mode,
16 windows are combined in two segments: central and
peripheral. The central segment includes four central
windows. All remaining windows belong to the peripheral
segment. Scene brightness is calculated as average luma in
each segment taken with certain weights.
The driver changes AE parameters (integration time,
gains, and so on) to drive brightness to the programmable
target. The value of the single step approach to the target
value can be controlled.
To avoid unwanted reaction of AE on small fluctuations
of scene brightness or momentary scene changes, the AE
driver uses a temporal filter for luma and a threshold around
the AE luma target. The driver changes AE parameters only
if the filtered luma is larger than the AE target step and
pushes the luma beyond the threshold.
Evaluative Algorithm
A scene-evaluative AE algorithm is available for use in
snapshot mode. The algorithm performs scene analysis and
classification with respect to its brightness, contrast, and
composure and then decides to increase, decrease, or keep
the original exposure target. It makes the most difference for
backlight and bright outdoor conditions.
Accelerated Settling During Overexposure
The AE speed is direction-dependent. Transitioning from
overexposure to target can take more time than transitioning
from underexposure. The AE driver has a mode that speeds
up AE for overexposed scenes.
The AE driver counts the number of AE windows whose
average brightness is equal to or greater than some value,
250 by default. For a scene that has saturated regions, the
average luma is underestimated because of signal clipping.
The driver compensates underestimation by a factor that can
be defined.
Exposure Control
To achieve the required amount of exposure, the AE driver
adjusts the sensor integration time, gains, ADC reference,
and IFP digital gains. In addition, ae_base_target (ID = 2,
offset = 0x4F) is available for the user to adjust the overall
brightness of the scene.
Flicker Detection and Avoidance
Flicker occurs when the integration time is not an integer
multiple of the period of the light intensity. The automatic
flicker detection block does not compensate for the flicker,
but rather avoids it by detecting the flicker frequency and
adjusting the integration time.
To reject flicker, integration time is typically adjusted in
increments of steps. The incremental step specifies the
duration in row times equal to one flicker period. Thus,
flicker is rejected if integration time is kept to an integral
factor of the flicker period.
Flicker cannot be avoided for integration times below the
light intensity period (10 ms for 50 Hz environment).
Flicker shows up in the image as horizontal bars that roll
up or down. The MCU looks for these rolling bars using
a thin horizontal window, which outputs luma average and
is applied to 48 points in the upper half of the image. The
MCU repeats the same sampling on the next frame; 48
samples from the previous frame are subtracted from
corresponding samples from the current frame. Skipping
more frames between subtraction can be set by a variable.
The MCU then smooths the 48 sampling points, applies an
amplitude threshold to avoid false detection, and looks at the
resulting waveform. If flicker is present, the waveform
should have a frequency within the search range. Assuming
the flicker power is a sine wave, subtracting two frames
results in:
sin(wt) * sin(wt ) a) + 2 sin
ǒ
a
2
Ǔ
@ cos
ǒ
wt )
ǒ
a
2
Ǔ
Ǔ
(eq. 18)
which is a cosine wave of the original frequency.
MT9D115
www.onsemi.com
27
Auto White Balance
The MT9D115 has a built-in AWB algorithm designed to
compensate for the effects of changing spectra of the scene
illumination on the quality of the color rendition. The
algorithm consists of two major parts: a measurement
engine performing statistical analysis of the image and a
driver performing the selection of the optimal color
correction matrix, digital gains, and sensor core analog
gains. While default settings of these algorithms are
adequate in most situations, the user can reprogram the base
color correction matrices, place limits on color channel
gains, and control the speed of both matrix and gain
adjustments.
Flash
To take a snapshot, the user must send a command that
changes the context from preview to snapshot. The typical
sequence of events after this command is:
1. The camera might turn on its LED flash, if it has
one and is required to use it. With the flash on, the
camera exposure and white balance are
automatically adjusted to the changed illumination
of the scene.
2. The camera captures one or more frames of
desired size. A camera equipped with a xenon
flash strobes while capturing images. When the
images are captured, the camera automatically
returns to context A and resumes running in
preview mode.
NOTE: This sequence of events can take up to 10
frames.
Histogram: Dark Level Adjustments, Low Light and
Tonal Controls
The histogram driver continually works to reduce image
flare and continually analyzes input image histogram and
dynamically adjusts the black level. When flare is present
(hence, the histogram does not contain dark tones), it causes
the driver to subtract a higher black level, thus regaining the
lost contrast. In certain situations, the scene may contain no
dark tones without flare. The histogram driver cannot
distinguish this situation and alters the black level just the
same, causing the image to have more contrast, which looks
acceptable in many situations.
Besides black level adjustments and low light scene
parameters, this driver also contains variables for the
preloaded and custom gamma tables.

MT9D115D00STCK25AC1-200

Mfr. #:
Manufacturer:
ON Semiconductor
Description:
INTEGRATED CIRCUIT
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union

Products related to this Datasheet