SMIA Functional Specification 1.0
SMIA Functional Specification 1.0
0 Part 1:
Functional
specification
DISCLAIMER
The contents of this document are copyright © 2004 Nokia Corporation, ST Microelectronics NV
and their licensors. All rights reserved. You may not copy, modify nor distribute this document
without prior written consent by Nokia and ST. No license to any Nokia’s, ST’s or their licensor’s
intellectual property rights are granted herein.
YOU ACKNOWLEDGE THAT THIS SMIA SPECIFICATION IS PROVIDED "AS IS" AND
NEITHER NOKIA, ST NOR THEIR LICENSORS MAKE ANY REPRESENTATIONS OR
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR
THAT THIS SMIA SPECIFICATION OR ANY PRODUCT, SOFTWARE APPLICATION OR
SERVICE IMPLEMENTING THIS SMIA SPECIFICATION WILL NOT INFRINGE ANY THIRD
PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. THERE IS NO
WARRANTY BY NOKIA, ST OR BY ANY OTHER PARTY THAT THE FUNCTIONS CONTAINED
IN THIS SMIA SPECIFICATION WILL MEET YOUR REQUIREMENTS.
History
Table of contents
1 Overview ......................................................................................................................16
1.1 Objective...................................................................................................................................... 16
1.2 The Specification......................................................................................................................... 18
1.3 Functional Profiles....................................................................................................................... 20
1.4 Key Concepts .............................................................................................................................. 21
1.4.1 Baseline Compliancy ........................................................................................................... 22
1.4.2 Intelligent Status Line .......................................................................................................... 22
1.4.3 Synchronisation ................................................................................................................... 23
1.4.4 Parameter Re-timing ........................................................................................................... 23
1.4.5 Generic Frame Format Description ..................................................................................... 23
1.4.6 Capability Registers/Parameter Limits ................................................................................ 23
1.4.7 Generic Control Interface .................................................................................................... 24
1.4.8 Personality file(s) ................................................................................................................. 24
1.4.9 Recommended Host Behaviour .......................................................................................... 24
1.5 Baseline Feature Chapter Summaries ........................................................................................ 25
1.5.1 Electrical .............................................................................................................................. 25
1.5.2 Operating Modes ................................................................................................................. 25
1.5.3 Data Format......................................................................................................................... 25
1.5.4 Video Timing........................................................................................................................ 25
1.5.5 Integration Time And Gain Control...................................................................................... 25
1.5.6 Colour Matrix ....................................................................................................................... 25
1.5.7 Camera Control Interface .................................................................................................... 25
1.5.8 Register Map ....................................................................................................................... 25
1.6 Additional Feature Chapter Summaries ...................................................................................... 26
1.6.1 Image Scaling ...................................................................................................................... 26
1.6.2 Compression ....................................................................................................................... 26
1.7 Extensions Beyond the Sensor Profile Levels ............................................................................ 26
1.7.1 Data Formats ....................................................................................................................... 26
1.7.2 DPCM/PCM Compression................................................................................................... 26
2 Electrical ......................................................................................................................27
2.1 Introduction.................................................................................................................................. 27
2.2 Sensor Module Pin Order............................................................................................................ 28
2.2.1 16-Pin Sensor Module ......................................................................................................... 28
2.2.2 14-Pin Sensor Module ......................................................................................................... 28
2.2.3 12-Pin Sensor Module ......................................................................................................... 29
2.3 Connection Pads ......................................................................................................................... 30
2.3.1 16-Pin Sensor Module ......................................................................................................... 30
2.3.2 14-Pin Sensor Module ......................................................................................................... 31
2.3.3 12-Pin Sensor Module ......................................................................................................... 32
2.4 Standard Support Circuit ............................................................................................................. 33
2.4.1 16-Pin Standard Support Circuit.......................................................................................... 34
2.4.2 14-Pin Standard Support Circuit.......................................................................................... 35
2.4.3 12-Pin Standard Support Circuit.......................................................................................... 36
2.5 External Clock ............................................................................................................................. 37
2.6 XSHUTDOWN ............................................................................................................................. 39
2.7 CCI .............................................................................................................................................. 39
2.8 Absolute Maximum Ratings......................................................................................................... 40
2.9 Operating Conditions................................................................................................................... 40
2.10 Average Current Consumption.................................................................................................... 41
2.11 Average Power Consumption...................................................................................................... 42
2.12 Peak Current Consumption ......................................................................................................... 42
2.13 Inrush Current.............................................................................................................................. 44
3 Operating Modes.........................................................................................................45
3.1 Introduction.................................................................................................................................. 45
3.2 Power Up Sequence ................................................................................................................... 47
3.3 Power Down Sequence............................................................................................................... 49
3.4 Internal Power-on Reset (POR) .................................................................................................. 52
3.5 Software-Reset Via CCI Interface ............................................................................................... 54
3.6 XSHUTDOWN ............................................................................................................................. 54
3.7 Mode Select Register .................................................................................................................. 55
3.8 Frame Count Register ................................................................................................................. 56
3.9 Power-Off .................................................................................................................................... 56
3.10 Hardware Standby....................................................................................................................... 56
3.11 Software Standby Mode .............................................................................................................. 56
3.12 Streaming .................................................................................................................................... 57
4 Data Format .................................................................................................................58
4.1 Introduction.................................................................................................................................. 58
4.2 Channel Identifier ........................................................................................................................ 58
4.3 Signalling Options ....................................................................................................................... 58
4.4 Output Format ............................................................................................................................. 58
4.5 Data Format Description ............................................................................................................. 59
4.6 Data Encoding for Uncompressed Image Data........................................................................... 61
4.6.1 Data Pedestal ...................................................................................................................... 62
4.7 Frame Format Overview.............................................................................................................. 63
4.7.1 Embedded Data Lines ......................................................................................................... 64
4.7.2 Dummy Pixel Data............................................................................................................... 64
4.7.3 Black Pixel Data (Zero Integration Time) ............................................................................ 64
4.7.4 Dark Pixel Data (Light Shielded Pixels)............................................................................... 64
4.7.5 Visible Pixel Data................................................................................................................. 65
4.7.6 Manufacturer Specific Pixel Data ........................................................................................ 65
4.7.7 Frame Blanking Period ........................................................................................................ 65
4.7.8 Line Blanking Period............................................................................................................ 65
4.7.9 Simple Profile Receiver Behaviour ...................................................................................... 65
4.8 Frame Format Description........................................................................................................... 66
4.8.1 2-byte Generic Frame Format Description .......................................................................... 67
4.9 Embedded Data Line Formats .................................................................................................... 72
4.9.1 Simplified 2-Byte Tagged Data Format ............................................................................... 74
5 Video Timing................................................................................................................79
5.1 Introduction.................................................................................................................................. 79
5.2 Image readout ............................................................................................................................. 80
5.2.1 User Readout Model............................................................................................................ 81
5.2.2 Programmable Image Size .................................................................................................. 81
5.2.3 Mirror/Flip............................................................................................................................. 87
5.2.4 Sub-Sampled Readout ........................................................................................................ 90
5.3 Line Length and Frame Length ................................................................................................... 92
5.3.1 Frame Length/Line Length CCI Message ........................................................................... 93
5.3.2 Frame Length/Line Length Requirements........................................................................... 93
5.4 Relationship between the External Clock Frequency and the Video Timing and Output Pixel
Clock Frequencies .............................................................................................................................. 94
5.4.1 Clock Examples................................................................................................................. 101
5.4.2 Clock Set up Capability Read Only Registers ................................................................... 102
5.4.3 Clock Frequency Requirements ........................................................................................ 104
5.5 Overall Video Timing Requirements ......................................................................................... 105
6 Integration Time and Gain Control ..........................................................................106
6.1 Overview.................................................................................................................................... 106
6.2 Integration time control.............................................................................................................. 106
6.2.1 Absolute Integration Time And Flicker Correction............................................................. 107
6.3 Analogue gain control................................................................................................................ 107
6.4 Digital Gain control .................................................................................................................... 109
List of tables
Table 1: Acronyms................................................................................................................................. xiv
Table 2: ECR ..........................................................................................................................................xv
Table 3: Functional Profiles ................................................................................................................... 20
Table 4: Data Rates............................................................................................................................... 21
Table 5: Connection Pad List for 16-pin Sensor Modules ..................................................................... 30
Table 6: Connection Pad List for 14-pin Sensor Modules ..................................................................... 31
Table 7: Connection Pad List for 12-pin Sensor Modules ..................................................................... 32
Table 8: Standard Support Circuit Reference Components .................................................................. 33
Table 9: EXTCLK input clock................................................................................................................. 37
Table 10: XSHUTDOWN Specifications................................................................................................ 39
Table 11: Absolute Maximum Rating..................................................................................................... 40
Table 12:Operating Conditions.............................................................................................................. 40
Table 13: Maximum Average Digital Supply Current Consumption vs. Operating Mode vs. Resolution
...................................................................................................................................................... 41
Table 14: Maximum Average Analogue Supply Current Consumption vs. Operating Mode vs.
Resolution ..................................................................................................................................... 41
Table 15: Maximum Average Power Consumption vs. Operating Mode vs. Resolution....................... 42
Table 16: Operating Mode Summary .................................................................................................... 45
Table 17: Power-Up Sequence Timing Constraints .............................................................................. 47
Table 18: Power Down Timing Constraints ........................................................................................... 49
Table 19: Internal Power on Reset Cell Specifications ......................................................................... 52
Table 20: Soft Reset Register (Read/Write) .......................................................................................... 54
Table 21: Soft Reset Specifications....................................................................................................... 54
Table 22: XSHUTDOWN Specifications................................................................................................ 54
Table 23: Mode Select Register (Read/Write)....................................................................................... 55
Table 24: Frame Counter Register ........................................................................................................ 56
Table 25: Device Identifier Registers..................................................................................................... 57
Table 26: CCP2 Channel Identifier Register ......................................................................................... 58
Table 27: CCP2 Signalling Mode Register............................................................................................ 58
Table 28: CCP Data Format Register.................................................................................................... 59
Table 29: Data Format Description Registers ....................................................................................... 61
Table 30: Video Encoding Parameters.................................................................................................. 61
Table 31: Data Pedestal Register.......................................................................................................... 62
Table 32: Typical Data Pedestal Values................................................................................................ 62
Table 33: Frame Format Description Codes ......................................................................................... 66
Table 34: 2-byte Generic Frame Format Description Registers............................................................ 70
Table 35: Embedded Data Format Codes............................................................................................. 73
Table 36: Tagged Data Format Tag Code Summary ............................................................................ 75
Table 37: Examples of Addressable Pixel Array Sizes ......................................................................... 83
Table 38: Pixel Array Address Registers (Read/Write) ......................................................................... 84
Table 39: Pixel Array Address Capability Registers (Read Only and Static) ........................................ 84
Table 40: Output Image Size Registers (Read/Write) ........................................................................... 85
Table 41: Image Orientation Register (Read/Write) .............................................................................. 88
List of figures
Figure 1: System Overview Example .................................................................................................... 16
Figure 2:System Examples.................................................................................................................... 17
Figure 3: SMIA Functional Specification Overview ............................................................................... 19
Figure 4: Sensor Module / Host Electrical Interface .............................................................................. 20
Figure 5: 16-Pin Out (Bottom View)....................................................................................................... 28
Figure 6: 14-Pin Out (Bottom View)....................................................................................................... 28
Figure 7: 12-Pin Order (Bottom View) ................................................................................................... 29
Figure 8: 16-Pin Standard Support Circuit ............................................................................................ 34
Figure 9: 14-Pin Standard Support Circuit ............................................................................................ 35
Figure 10: 12-Pin Standard Support Circuit .......................................................................................... 36
Figure 11: Clock Options ....................................................................................................................... 38
Figure 12: VGA Average Power Consumption Example....................................................................... 42
Figure 13: VGA Peak Current Consumption Example 1 ....................................................................... 43
Figure 14: VGA Peak Current Consumption Example 2 ....................................................................... 43
Figure 15: System State Diagram ......................................................................................................... 46
Figure 16: Power Up Sequence ............................................................................................................ 48
Figure 17: Power Down Sequence........................................................................................................ 50
Figure 18: Exit from Streaming Mode when the CCI command is received during the output of a frame
of CCP2 data ................................................................................................................................ 51
Figure 19: Exit from Streaming Mode when the CCI command is received during the inter frame period
...................................................................................................................................................... 51
Figure 20: Power On Reset Power up Timing....................................................................................... 53
Figure 21: Power On Reset Supply “Glitch/Brown-out” Timing............................................................. 53
Figure 22: XSHUTDOWN Timing Specification .................................................................................... 55
Figure 23: CCP Data Format Register .................................................................................................. 59
Figure 24: Data Format Description – Profile Level 0 Example ............................................................ 61
Figure 25: Data Format Description - Profile Level 1 Example ............................................................. 61
Figure 26 - Frame Format ..................................................................................................................... 63
Figure 27: 2-byte Generic Frame Format Descriptor ............................................................................ 67
Figure 28: Frame Format Subtype register - Number of Column and Row descriptors used............... 68
Figure 29: Generic Frame Format Description - SVGA Example ......................................................... 71
Figure 30: Embedded Data Line Format ............................................................................................... 72
Figure 31: Tagged Data Format ............................................................................................................ 74
Figure 32: 2 Byte Tagged Data Packet - Data Packing for RAW8 and RAW10 Data Formats ............ 76
Figure 33: RAW8 Embedded Data Packing .......................................................................................... 77
Figure 34: RAW10 Embedded Data Packing ........................................................................................ 77
Figure 35: Embedded Data Example .................................................................................................... 78
Figure 36: Video Timing Overview ........................................................................................................ 80
Figure 37: User Readout Model ............................................................................................................ 81
Figure 38: Programmable Image Size................................................................................................... 82
Figure 39: Basic Image Format plus Additional Border Rows............................................................... 83
Figure 40: Output Image Size Example................................................................................................. 86
Figure 41: Standard Readout ................................................................................................................ 87
PREFACE
Following publication of the SMIA Standard, there may be future approved errata and/or approved
changes to the standard prior to the issuance of another formal revision.
The following ECRs have been incorporated into this version of the specification:
ECR DESCRIPTION
Table 2: ECR
1 Overview
1.1 Objective
The SMIA Functional Specification objective is to fully standardise the electrical, control and image
data interfaces for raw Bayer sensor modules targeted at mobile applications. Knowing how the basic
system will function regardless of camera attachment resolution and frame-rate by baseline
compliancy
The main objective is driven by the requirement to be able to connect ANY SMIA compliant sensor to
ANY SMIA compliant host system with matching capabilities and get a working system with acceptable
performance.
This self configuration nature is a key feature of the Functional Specification and vital to the overall
SMIA objectives
The functional specification must be equally applicable to both software host implementations as well
as hosts implemented with dedicated hardware machines. There can also be back channel from host
system to the ISP that is not drawn in Figure 1 and in Figure 2.
In this context the host system may be either an Application Engine, a base band or a display chip.
The AEC, AWB and image reconstruction algorithms required to make a complete the ‘Camera’
system can be implemented is a variety of ways
• Software on a DSP/Processor.
• Hybrid approach of mixed software and programmable hardware.
The above implementations can be either part of the Application Engine or a separate Image Signal
Processor device.
Vendor 1
Vendor A
Vendor 2
Vendor B Application Engine /
Bayer Vendor
Base 3 / Display Chip
band
Vendor C
Patterned Raw Bayer Data Interface Application Engine /
Bayer BaseApplication
band / Display Chip
Sensor And Sensor Control Image Engine /
Patterned
Bayer Reconstruction
Base band /Display Chip
Sensor
Patterned Image
Function
RAW Reconstruction
Sensor Image
Function
Reconstruction
Function
SMIA Sensor
Modules
Beyond the ‘baseline’ profile there are 2 incremental profile levels which add image scaling and image
compression features.
The host receiver must support all of the profile levels. Thus a host receiver must support the RAW10,
RAW8 data formats and 10-bit to 8-bit DPCM/PCM decompression
In the application the sensor module set-up/configuration parameters are mastered by a ‘personality
file’ when available in the software stack, this is also capable of setting up the parameterised
reconstruction chain according to the sensor module attached in order to customise the look and feel
of the camera, and allowing a route for specification evolution and manufacturer specific customisation
without compromising the fundamental issue of compatibility
It is important that the specification can be read and implemented not only by Module builders, but
also by those implementing the Host system including the software application. The benefits of a well-
controlled and clear Functional Specification for both Module and Host implementers are:
• A single generic model describing the behaviour of all of image sensor modules
• Guaranteed sensor module / host inter-operability.
• A single host implementation can work with a wide range of sensor modules.
• A single Module implementation can work with a wide range of hosts.
The Functional specification adds a layer on top of the CCP2 specification in that it fully defines the
sensor modules electrical, control and image data interfaces.
The physical and logical layers of the SMIA Functional specification is compliant with the CCP2
specification.
• CCP2
CCP2 is a 4-wire Low EMI SubLVDS data link. The maximum data rate is 650 Mbps.
This is sufficient to support readout of an image of up to 2 Mega Pixels in a 1/30th of a second
using the RAW8 CCP2 mode.
• CCI
The 2-wire camera control interface is I2C compatible. The maximum data rate is 400 kHz.
• Low frequency external clock (6 – 27MHz)
• Chip enable signal - XSHUTDOWN
• Analogue Power
• Digital Power
Sensor Module
Control Interface Image Data Interface
Functional Specification
Application Notes
Analogue Digital
Power, Power, XTAL
VANA VDIG
EXTCLK
PLL
VDIG
SCL 2
CCI CCI/I C
Slave SDA Master
CCP TX CCP RX
DATA+
DATA-
CLK+
CLK-
The incremental nature of the profiles allows level 1 or 2 devices to be specified initially and as the
capabilities of the base-bands increase or with the integration of video DSP type hardware in the base-
bands, profile level 0 devices can be specified instead without needing to change the SMIA
specification.
Levels 1-2 represent an increasing level of data rate reduction for video applications i.e. viewfinder in
high resolution sensor modules.
Output Signalling
Data Rate Type
<= 208 Mbps Data/Clock
>208 Mbps Data/Strobe
• 10-bit pixel data truncated to 8-bits (i.e. top 8-bits of the 10-bit data)
• 10-bit pixel data compressed to 8-bits via the DPCM/PCM specified in the
compression chapter.
Baseline Features
• Electrical
• Operating Modes
• Data Format
• Video Timing (including programmable Window of Interest)
• Integration Time and Gain Control
• Colour Matrix
• Test Modes
• Camera Control Interface
• Register Map
• Recommended Host Behaviour
Additional Features:
• Image Scaling - 3 Levels None, Horizontal and Full (Horizontal and Vertical)
• 10-bit to 8-bit DPCM/PCM raw Bayer Compression
External References
Also defined within this specification are additional data format and image compressions options,
which are extensions beyond the sensor profile levels.
It is important to emphasise that these extensions are NOT part of the sensor profiles.
For example the baseline compliancy for integration time and analogue gain is coarse integration time
and a single global gain value. If a sensor module has per channel analogue gain capability, its default
(baseline) behaviour must be as if it has a single global analogue gain. If the host receiver AEC/AWB
supports analogue gain per channel the host can discover this via the gain capability register and then
enable this feature. Similar baseline behaviours are also single scaling factor and scaling step in
Image Scaling (Chapter 9) and only even divider values used in Video Timing (Chapter 5).
This is necessary to create a common baseline behaviour across all sensor modules and thus
guaranteeing sensor/host interoperability.
All of the sensor module defaults must be baseline compliant i.e. RAW10 data format, no image
scaling, not image compression, global analogue gain behaviour, coarse integration and only even
divider values.
This embedded data contains the contents of the sensor modules CCI registers and thus fully
describes the state of the sensor module
The embedded data at the start of the frame is termed the “Intelligent status line(s)”.
• Generic frame format description describing the content and structure of the frame of
CCP2 image data.
• Integration Time and Gain Parameters
• Video Timing Parameters
A good analogy is the EXIF information (header) within a JPEG image file.
• To enable the co-processor the receiver to process arbitrary sized images, via the
generic frame format description
• It provides the co-processor with a fast method of receiving the contents of the image
sensors internal CCI register values
• It lowers the overhead of CCI communications on the co-processor microprocessor by
eliminating the need when the imager is streaming video data for the co-processor to
read via the CCI serial interface.
This is of particular help when the viewfinder, AEC and AWB functions are being performed in
software or in firmware running on a microprocessor with a limited number of MIPS.
Use of the “Intelligent Status Line” must be a central feature of the host receiver implementations.
1.4.3 Synchronisation
Sensor control commands, status data and the control loops that run on the host need to be
synchronised, for example Automatic White Balance and Exposure.
This is a vital point for the use of the data with the “Intelligent Status Line”.
The embedded data must be correct for image data contained in that frame. For example the
integration time and gain parameter values reported are those that are used by the subsequent image
data output within that frame. Additionally the information for next frame image parameter values can
be reported, if they are already available.
The host must use the values contained in the Intelligent Status line to synchronise the AEC and AWB
control loops. For example after the host transmits a new set of integration time and gain parameters it
waits for the new parameter values to appear in the Intelligent Status Line. Thus the host knows
exactly when the first frame with the updated integration time and gains values appears.
This is a vital point for ensuring correct system behaviour for exposure control, as if the system thinks
it has a different exposure/gain in the sensor than it really has, ‘because it is out of sync’, then it may
apply the wrong digital gain for that frame causing image flashes to be observed.
Integration time, gain and video timing parameters must be consistent within a frame of image data.
To achieve this the sensor module control registers must be internal re-timed so that they are always
applied at the start of the next frame.
In practise this means that there is an optimum period for dynamic sensor control commands to be
sent to the sensor to minimise the loop time and improve the response of the system.
The frame format information is available to either software or hardware receiver via both CCI
Registers and the embedded data within the intelligent status line.
• Integration Time
• Analogue Gain
• Line Length
• Frame Length
Thus for example the AEC/AWB control loops can be automatically configured without the host having
to have prior knowledge of the sensor behaviour.
The capability information read form the sensor module is merged with any information contained in
the personality file – the personality file values have priority over sensor module values – and merged
set of information is used by the host system.
A host receiver implementation must go beyond the baseline specification in the features it supports. A
host receiver must support the following data formats.
SMIA 1.0 Part 3.1: Software and Application specification defines how the host should use the
features specified in the functional specification to achieve a sensor module / host interface which is
self-configuring. Example areas covered
1.6.2 Compression
Image Compression option:
• 10-bit to 8-bit DPCM/PCM based image compression.
2 Electrical
2.1 Introduction
This chapter defines the sensor module’s electrical interface. The areas defined are:
For the full details of the CCP2 and CCI interfaces please refer to the SMIA 1.0 Part 2: CCP2
specification.
An important part of the SMIA electrical specification is providing the worst-case current consumption
figures for the mobile phone’s power management design.
Thus if the phone’s power management is designed to supply the maximum currents for the chosen
resolution, then it will be compatible with all SMIA compliant sensor modules with that resolution.
Without this guaranteed compatibility between a phone’s power management design and the sensor
module it is not possible to swap in and out different manufacturers sensor modules within the same
phone platform.
Pad 1 NC NC Pad 16
VCAP DGND
AGND DATA+
VANA DATA-
XSHUTDOWN VDIG
EXTCLK CLK+
SCL CLK-
AGND DATA+
VANA DATA-
XSHUTDOWN VDIG
EXTCLK CLK+
SCL CLK-
VANA DATA-
XSHUTDOWN VDIG
EXTCLK CLK+
SCL CLK-
Figure 8, Figure 9 and Figure 10 detail the standard support circuits for 16-pin, 14-pin and 12-pin
modules respectively.
Table 8 defines the values for the reference components used in the support circuit.
VANA VDIG
N N
CB CB
NC NC
VCAP DGND
CL
AGND DATA+
RT
VANA DATA-
Standard XSHUTDOWN
100Ω Balanced
VDIG
GenIO Transmission Line
VDIG
EXTCLK CLK+
RP RP
L RT
OC or OD
SCL CLK-
GenIO
OC or OD
SDA DGND
GenIO
CL CL
VANA VDIG
N N
CB CB
CL VCAP DGND
AGND DATA+
RT
VANA DATA-
Standard XSHUTDOWN
100Ω Balanced
VDIG
GenIO Transmission Line
VDIG
EXTCLK CLK+
RP RP
RT
OC or OD
SCL CLK-
GenIO
OC or OD
SDA DGND
GenIO
CL CL
VANA VDIG
N N
CB CB
CL VCAP DATA+
RT
VANA DATA-
Standard XSHUTDOWN
100Ω Balanced
VDIG
GenIO Transmission Line
VDIG
EXTCLK CLK+
RP RP
RT
OC or OD
SCL CLK-
GenIO
OC or OD
SDA GND
GenIO
CL CL
The external clock can either be either a DC coupled square wave, or an AC coupled sine wave. In
either case, the clock may have been RC filtered
The external clock may be either a free-running system clock or a dedicated sensor module clock,
which can enabled and disabled by the host.
The maximum input voltage of the external clock is 2.9V and nominal supply voltage for the sensor
digital pads is 1.8V.
The ESD protection circuitry of the sensor modules clock input pad must not clip or distort the input
clock shape even when XSHUTDOWN is low, the sensor module is powered down and/or the
modules power supplies are not present.
Range
EXTCLK Unit
Min Typical Max
DC coupled Square Wave 1.0 1.8 2.9V V
AC coupled Sine Wave 0.5 1 1.2 V p-p
Frequency 6.0 27.0 MHz
Duty Cycle 45 55 %
Input Leakage -10 10 µA
A PLL (Phase Locked Loop) block is embedded with the sensor module. The PLL generates all the
necessary internal clocks from the external clock input.
Option 1: DC Coupled
PWRDN PWRDN
Option 2: AC Coupled
PWRDN PWRDN
PWRDN PWRDN
PWRDN PWRDN
2.6 XSHUTDOWN
XSHUTDOWN is an asynchronous system reset signal. It is active low.
The maximum input voltage of the XSHUTDOWN signal is 2.9V and nominal supply voltage for the
sensor digital pads is 1.8V.
The ESD protection circuitry of the sensor modules XSHUTDOWN pad must not clip the input voltage
level even when the sensor module is powered down and/or the modules power supplies are not
present.
2.7 CCI
The sensor control interface must comply with the CCI specification contained in the CCP2
specification with the following constraints:
The maximum input voltage of the SCL and SDA signals is 2.9V and nominal supply voltage for the
sensor digital pads is 1.8V.
The ESD protection circuitry of the sensor modules SCL and SDA pads must not clip the input voltage
level even when XSHUTDOWN is low, the sensor module is powered down and/or the modules power
supplies are not present.
Note: Peak currents are included in the average current consumption figure.
Measurement conditions:
Table 13: Maximum Average Digital Supply Current Consumption vs. Operating Mode vs.
Resolution
Notes:
Max Current
Mode Units
All Profiles
Hardware Standby 5 (1) µA
Software Standby 50 (2) µA
Streaming (3) VGA 15 mA
SVGA 18 mA
1MP 26 mA
UXGA 40 mA
Table 14: Maximum Average Analogue Supply Current Consumption vs. Operating Mode vs.
Resolution
Notes:
3. Streaming Conditions: Readout of the full raw Bayer image at the maximum frame rate.
Measurement conditions:
30.0
20.0
IDIG (mA)
15.0
Line of 60mW constant power
10.0
Allowable
Area (VGA)
5.0
IANA (mA)
5.0 10.0 15.0 20.0
Table 15: Maximum Average Power Consumption vs. Operating Mode vs. Resolution
Notes:
1. Streaming Conditions: Readout of the full raw Bayer image at the maximum frame rate.
Measurement conditions:
The peak current must be less than 1.333 times the maximum average current specification for that
operating mode.
Maximum duty cycle of the high part to the low part of the current waveform is 33% with a worst-case
period of 500µs
10µs
Peak Current
20mA
Consumption
I(VANA)
Maximum Average
15mA
Current Consumption
12.5mA
20µs
20µs
Peak Current
20mA
Consumption
I(VANA)
Maximum Average
15mA
Current Consumption
12.5mA
40µs
133µs
Peak Current 20mA
Consumption
I(VANA)
Maximum Average
15mA
Current Consumption
12.5mA
333µs
Measurement conditions:
3 Operating Modes
3.1 Introduction
The sensor module has 4 operating modes (Table 16).
The host should configure and control the sensor module using only the above 4 operating modes.
Moving from one mode to another is achieved by issuing the appropriate mode command via the CCI
serial control interface, the XSHUTDOWN signal changing state and the power supplies.
The sensor module also has “Soft-Reset” CCI command that resets of the registers back to their
defaults and puts the sensor module into the software standby mode.
Figure 15 defines the valid mode changes for the sensor module.
A manufacturer can define additional operating modes, but the sensor module must be able to
configured and controlled by a host without the using these extra operating modes.
POWER
OFF
Power
Power Supplies Supplies are
turned ON and
Are Turned OFF
XSHUTDOWN
is Low
Power
Supplies are Power
turned ON and Supplies
HARDWARE
XSHUTDOWN Are
STANDBY
is High Turned
OFF
XSHUTDOWN XSHUTDOWN
goes Low goes High
SOFTWARE
STANDBY
CCI CCI
STREAMING
On power up:
• If XSHUTDOWN is low when the power supplies are brought up then the sensor
module will go into hardware standby mode.
• If XSHUTDOWN is high when the power supplies are brought up then the sensor
module will go into software standby mode
In both cases the presence of an on-chip power-on reset cell ensures that the CCI register values are
initialised correctly to their default values.
The EXTCLK clock can either be initially low and then enabled during software standby mode or
EXTCLK can be a free running clock.
VDIG (1.8V)
t0 t1
VANA (2.8V)
(VDIG rising first)
VANA (2.8V)
(VANA rising first)
t6 t7
t2 (fixed) (variable)
VDIG and VANA
may rise and fall
XSHUTDOWN in any order. t3
EXTCLK
(Free running)
EXTCLK
(Gated)
CCISDA t4 t5
CCISCL
CCPQCLKP/N
HighZ (tri-state)
CCPDATAP/N
HighZ (tri-state)
Frame Count
0xFF 0x00
Register
Similarly to the power-up sequence the EXTCLK: input clock may be either gated or continuous.
If the CCI command to exit streaming is received while a frame of CCP2 data is being output then the
sensor module must wait to the CCP2 frame end code before entering software standby mode.
If the CCI command to exit streaming mode is received during the inter frame time then the sensor
module must enter software standby mode immediately.
VDIG (1.8V)
t4 t5
VANA (2.8V)
(VANA falling first)
VANA (2.8V)
(VDIG falling first)
t3
VDIG and VANA
may rise and fall
XSHUTDOWN t2 in any order.
EXTCLK
(Free running)
EXTCLK
(Gated)
EXTCLK may either be free running or gated. The requirement is that EXTCLK
must be active for time t1 after the last I2C transaction or after the CCP frame
end embedded code, whichever is the later event.
CCISDA t0 t1
CCISCL If CCI command received during the readout of the frame then the sensor
must wait after the CCP end of frame code before entering sleep mode.
Enter If the CCI command is received during the inter frame time the sensor
Sleep must enter sleep mode immediately
CCPCLKP/N
HighZ (tri-state)
CCPDATAP/N
HighZ (tri-state)
CCISDA t1
CCISCL CCI command received during the readout of the frame then the sensor
must wait after the CCP end of frame code before entering Software
Enter Standby mode.
Softwa
re
CCPCLKP/N
HighZ (tri-state)
CCPDATAP/N
HighZ (tri-state)
Figure 18: Exit from Streaming Mode when the CCI command is received during the output of a
frame of CCP2 data
CCISDA
CCISCL
CCI command is received during the inter
frame time sensor enters sleep mode
Enter immediately
Softwa
re
CCP2CLKP/N
HighZ (tri-state)
CCP2DATAP/N
HighZ (tri-state)
Figure 19: Exit from Streaming Mode when the CCI command is received during the inter frame
period
The host must be able to reset the sensor by turning the power supplies on and off.
Vtrig_rising
Digital
Power
Supply, Vtrig_falling
VDIG
t1 t3 t1
Burst < t5
Vtrig_rising
Digital
Power
Supply, Vtrig_falling
VDIG
t1 t3 t1
This “Soft Reset” puts the sensor module into Software Standby mode and then power-up sequence
detailed earlier must be followed to generate streaming image data for the sensor module.
The purpose of this bit is to allow a CCI command to reset the sensor module to a known state, if the
host system loses track of the state of the sensor module.
3.6 XSHUTDOWN
XSHUTDOWN is an asynchronous system reset signal. It is active low.
If XSHUTDOWN goes low in any mode other than the power off state the sensor module must
immediately move in to hardware standby mode. When XSHUTDOWN goes high and the power
supplies are present the sensor moves into software standby mode.
XSHUTDOWN low resets all of the CCI registers to their default values.
t1 t1
0.7 * VDIG
XSHUTDOWN 0.5 * VDIG
0.3 * VDIG
t2
When 255 is reached the counter rolls over to 0 and starts incrementing again
During Software Standby modes the frame counter is reset to 255 (FFH)
3.9 Power-Off
The power-off state is defined as either or both of the digital and analogue supplies not present.
Requirements:
This mode maintains the minimum logic required to preserve the existing set-up and to communicate
with the sensor using the CCI serial interface.
Requirements:
• The EXTCLK clock must be active for CCI communications with the sensor module.
• All read/write CCI registers must be able to read from or written to in software standby
mode.
• All read only CCI registers must be able to read from in software standby mode.
• CCI commands must be able to be received at any point in time.
• The values of the serial interface registers, e.g. exposure and gain, are preserved.
• The CCP2 data and clock pads are high impedance.
During the power-up sequence then the host system or co-processor should read the sensor module’s
device identifier registers (Table 25)
From the values contained in the device identifier registers the host system can determine the model
number, revision, manufacturer and SMIA version of the sensor module.
The clock divider and PLL multiplier registers must be configured during Software Standby mode while
the PLL is powered down.
3.12 Streaming
In this mode the sensor module streams live video to the host system/co-processor.
It is mandatory that when a CCI command is received to exit the streaming mode the sensor module
completes the current frame of CCP2 data before entering the software standby mode.
If the software standby mode command is received during the frame blanking time then the mode
change is immediate.
The sensor module PLL (phase locked loop) via the CCP2 Clock provides the system clock for co-
processor devices.
4 Data Format
4.1 Introduction
Requirements for the image data interface
The default value for this register is 0x00 for backward compatibility with older CCP2 receivers.
• Data/Clock Signalling: Positive edge of the data qualification clock qualifies the data
• Data/Strobe Signalling: The data qualification clock becomes a strobe signal which
toggles state whenever the data does not change
B7 B0 B7 B0
If the MS and LS bytes have the same value then the image data has not been compressed.
Examples
All data format mode changes must be performed in the software standby mode.
This description is made up of a data format model type byte, a data format model sub-type byte,
followed by list of 2-byte descriptors (Table 29). The format of a descriptor is the same as for the
CCP_data_format register (Figure 23).
In sensor module is required to automatically pad lines with dummy pixels to ensure that the number
of pixels between the line start sync code for line m and the line end sync code for line m is a multiple
of the appropriate number of pixels for the RAW format used (e.g. 4 pixels for RAW8, 16 pixels for
RAW10)
The number of dummy pixels must be described by one of the frame format descriptors.
Figure 24 and Figure 25 contain examples of the data format descriptor for profile level 0 and profile
level 1 sensor modules.
Descriptor 0 0AH 0AH Top 10-bits of internal pixel data. Transmitted as RAW10
Descriptor 0 08H 08H Top 8-bits of internal pixel data. Transmitted as RAW8
Descriptor 1 0AH 08H Top 10-bits of internal pixel data compressed to 8-bits.
Transmitted as RAW8
Descriptor 2 0AH 0AH Top 10-bits of internal pixel data. Transmitted as RAW10
Video data in which the 8 most significant bits are all set to 0’s are illegal data values. This is
necessary to prevent the generation of false CCP embedded escape sequences from occurring within
the video data. RAW10 false sync code protection in addition to limiting pixel data to 4-1023 after data
packing every 5th byte (containing LSBs) has to be examined and force the bit 4 (P3 bit 0) ‘1’ if the
byte is all zeros.
Consequently only 255 of the possible 256 8-bit values or 1020 of the possible 1024 10-bit values may
be used to express a pixel value.
Thus
The sensor module must have an internal calibration function, which ensures that data pedestal value
remains constant with integration time, gain, and temperature and between different sensors.
The host system should always use the data_pedestal register value to determine the sensor
output black level.
FS 1 or more Embedded Data Line(s) Start of Frame line(s) (or Status Line)
contains the values of CCI register
indices 0x0000 to 0x0FFF inclusive.
Image Data
Checksum
• Integration time/Gain Values
The dummy, black, dark, visible and • Line Length
manufacturer specific image data can • Frame Length
be in the form any combination of rows • The frame format description
and columns
Dummy, Black, Dark, Visible and values of the CCI register indices
manufacturer specific pixel data may 0x2000 to 0x2FFF inclusive.
be optionally included.
Checksum
While the image data may be compressed via the 10-bit to 8-bit DPCM/PCM algorithm the embedded
data is never compressed. Thus when the compression is used the frame of CCP2 data contains a
mixture of uncompressed data – the embedded data lines – and compressed data – the image data.
The 1 or more embedded data lines at the beginning of the frame are termed Start of Frame Line(s)
(SOF)
The start of frame line(s) or status line(s) must contain the values of the CCI registers that exist
between indices 0x0000 to 0x0FFF. Additional manufacturer specific registers may also be included.
The SOF line(s) includes the SMIA 5-byte device identifier, frame counter (0-255), the integration time
and gain register values, line and frame length plus the frame format description.
The very first embedded data line at the start of a frame must contain the frame format description.
The presence of the SOF lines(s) enables the sensor set up and configuration data to be automatically
extracted by either software or by a separate image-processing device. Thus minimising the CCI
communication overhead.
The 0 or more blank lines at the end of the frame are termed End of Frame Line(s) (EOF)
The EOF lines(s) must contain the values of CCI registers that exist between indices 0x2000 to
0x2FFF. Additional manufacturer specific registers may also be included.
The EOF line(s) contain the statistics configuration data and the values of the statistics gathered.
The structure of the image data including the number of embedded data lines at the start and end of
the field is fully described by the frame format description which is part of the data embedded within
the first SOF line of the frame of CCP2 data.
The frame format description and the embedded data format are described later in Section 4.8 and
Section 4.9 respectively.
The minimum requirement is to have 1 embedded data line at the start of the frame. If the number of
CCI registers to be output is greater than the distance between the CCP2 embedded line start and line
end codes allows then more embedded data lines can be added at either the start or the end of the
frame as required.
The number of embedded data lines at the start and end of the frame is specified as part of the frame
format description.
The image sensor uses the data from these pixels to automatically calibrate the sensors output black
level (data pedestal)
The objective of this information is to enable either software or a dedicated image processing device to
be able to process arbitrary sized images without any prior knowledge of the image sensors image
format.
The frame format model information is available to either software or a dedicated image-processing
device via both CCI Registers and the embedded data line at the start of the frame.
The visible pixel frame format model information read via CCI Registers is not guaranteed to be up to
date if the sensor module is in software standby mode. This is because new x_output_size and
y_output_size values programmed during software standby mode will not be applied until the
sensor module enters the streaming mode.
The intention is that the software or the dedicated image-processing device automatically configures
itself by extracting the frame format details from the start of frame line(s) (Status Line).
The first embedded data line at the start of a frame must contain the frame format description.
This is very important for applications like for example digital zoom where the sensor module’s image
size may varying dynamically over time.
The frame_format_model_type register specifies which frame format description that particular
sensor is using.
The aim of the generic frame model specified is to provide a flexible way of describing the format of an
image frame that enables simple profile receivers to extract only the embedded data lines and visible
pixel data from the frame of CCP2 frame but contains enough information that manufacturer specific
software or co-processors can extract and use the additional pixel data which may be also included
within the frame of CCP2 data transmitted by the sensor.
Code Description
00H Illegal
01H 2-byte Generic Frame Format Description
FFH Illegal
• A CCP2 frame of raw Bayer data can include embedded, dummy pixel, black pixel,
dark pixel, visible pixel and manufacturer specific pixel data.
• The dummy, black, dark, visible and manufacturer specific pixel data can be in the
form of any combination of columns and/or rows.
• The embedded data must only be used in rows.
• There must be at least 1 embedded data line at the start and the end of the frame.
B7 B4 B3 B0 B7 B0
B7 B4 B3 B0
Figure 28: Frame Format Subtype register - Number of Column and Row descriptors used
The frame_format_model_subtype register specifies the number of descriptors used to describe
the columns and the rows.
The top 4-bits of the register specifies the number of column descriptors, Dcol.
The bottom 4-bit of the register specifies the number of row descriptors, Drow.
A simple profile receiver must be able extract the embedded data lines and the visible image pixel
data from all of the examples of the generic frame format description are given in the following pages.
The first embedded data line at the start of a frame must contain the frame format description.
FS
3 Embedded Data Lines
Checksums
8 Dummy Pixel Columns
LS LE
Visible Pixels
808 x 608
C C
FE
R
Number of Column Descriptors: 2
3 Embedded Rows 4 MSP Type 0 Rows 2 Dark Rows 608 Visible Rows
1H 0H 03H 8H 0H 04H 4H 0H 02H 5H 2H 60H
Descriptor 2 Descriptor 3 Descriptor 4 Descriptor 5
Figure 29: Generic Frame Format Description - SVGA Example
An example of this is the frame format description, which must be included in the embedded data line
at the start of frame
The embedded data line format is fully specified in the following sections:
FS/LS EDF Data Data Data Data Data Data Data Data 07H 07H 07H 07H FE/LE
32-bit CCP Embedded Embedded Data 07H Padding 32-bit CCP Embedded
Start of Line Sync Codes Characters End of Line Sync Codes
FS/LS 07H 07H 07H 07H 07H 07H 07H 07H 07H 07H 07H 07H 07H FE/LE
FS/LS 0AH Tag Data Tag Data Tag Data Tag Data 07H 07H 07H 07H 07H 07H FE/LE
32-bit CCP Embedded Tagged Tagged Tagged Tagged 07H Padding 32-bit CCP Embedded
Start of Line Sync Codes Data 0 Data 1 Data 2 Data 3 Characters End of Line Sync Codes
FS/LS 0AH Tag Data Tag 55H Data Tag Data 07H 55H 07H 07H 07H 07H 55H FE/LE
32-bit CCP Embedded Tagged Tagged Tagged 07H Padding 32-bit CCP Embedded
Start of Line Sync Codes Data 0 Data 1 Data 2 Characters End of Line Sync Codes
FS/LS 0AH Tag 55H Data Tag 55H Data 07H 55H 07H 07H 07H 55H 07H 55H FE/LE
32-bit CCP Embedded Tagged Tagged 07H Padding 32-bit CCP Embedded
Start of Line Sync Codes Data 0 Data 2 Characters End of Line Sync Codes
• Data Tags
The CCI register index is auto incremented AFTER the data byte.
There are two data tags one for valid data and a second for null data.
Null data is when a CCI a register value for the current CCI index does not exist. In this case
07H is output as the data byte value.
For the Null data tag the receiver or host system must always ignore the data byte value.
The data byte contains either the MSB or the LSB of the CCI register index.
The first is using both the MSB and LSB address tags together to from a “long” jump over
large areas of un-used CCI register space.
The second way is using only the LSB address tag, to implement a “short” jump over small
areas of un-used CCI register space.
• Special Tags
The tag values used are sufficient to prevent false CCP2 synchronisation codes from occurring with
the embedded data as it is not possible to generate a sequence of 16 consecutive 0’s.
General Rules:
• The embedded data sequence of tags and the number of embedded data lines must
not vary dynamically from frame to frame.
This is to speed up software-based systems by allowing the host to build up a positional map
(pixel number N = the value for CCI register M) of from the embedded data lines in the first
frame of image data received by the host system.
• The maximum number of tag-data pairs is 127. This is for compatibility with horizontal
scaled output modes where the output image width may be only 256 pixels.
• The MSB and LSB Address Tags must always be used together.
• Of the two tags the MS Register Index Byte tag must be specified first.
• The MSB and LSB Address Tags must be the first two tags at the start of the
embedded data.
• The 4 byte MS/LS Register Tag sequence can occur anywhere in the embedded data,
for example to jump over large sections of un-used register locations
• The jump may be either forward or backwards within the CCI register space.
RAW8:
T7 T6 T5 T4 T3 T2 T1 T0 D7 D6 D5 D4 D3 D2 D1 D0
RAW10:
T7 T6 T5 T4 T3 T2 T1 T0 0 1 D7 D6 D5 D4 D3 D2 D1 D0 0 1
Figure 32: 2 Byte Tagged Data Packet - Data Packing for RAW8 and RAW10 Data Formats
Data
Format Tag Data Tag Data Tag Data Tag Data Tag Data Tag Data Tag Data Tag Data
Code
FS/LS 0AH AAH 00H A5H 00H 5AH 22H 5AH 70H 5AH 00H 5AH 0AH 55H 07H 07H 07H
CCI Register Index XX XXH 00 XXH 00 00H 00 01H 00 02H 00 03H 00 FFH 01 00H
5 Video Timing
5.1 Introduction
This chapter defines the following Video Timing functions:
This chapter specifies the video timing for the image data that is readout from the sensor modules
pixel array. This is not necessarily the same size as the output image data.
Features such as programmable image size and sub-sampled modes all effect the size of image read
from the pixel array. For these features the output image is the same size as the image read from the
pixel array.
The programmable image size, digital image scaling and output size are independent functions. It is
the responsibility of the host to ensure that these functions are programmed correctly for the intended
application. These functions are used to reduce amount of data and also reduce the peak data rate of
CCP2.
Integration time parameters are specified in terms of the video timing for the pixel array.
The application of all of the video timing read/write parameters must be re-timed to the start of frame
boundary to ensure that the parameters are consistent within a frame.
For the CCI indices of the registers defined in this section please refer to the CCI Register Map
Chapter.
The Video Timing Application Note presents an example method that a host system can use to
configure and control the sensor’s module’s video timing and use the information in the video timing
capability registers.
x_addr_start x_addr_end
X-address
y_addr_start
Y-address
Pixel
Array
y_addr_end
ADC
(x_addr_start, y_addr_start)
(x_addr_end, y_addr_end)
frame_length_lines
Black/Dark
Level Calibration Pixel Array
Image Data
Scaler
line_length_pck
Output Coder
& CCP TX
y_output_size
Scaled
Output Image
x_output_size
up_down
even_inc Address Counter Address
odd_inc
addr_start addr_end
In non-sub-sampled readout modes the counter will count either up from the start address to the end
address (inclusive) or down from the end address to the start address (inclusive).
The mirror and flip control bits determine the direction of the address count.
If the counter is counting up the termination condition is greater than the end address.
If the counter is counting down the termination condition is less than the start address.
To model sub-sampled readout modes the counter has two increment values.
• even_inc
The amount the address counter is incremented for EVEN pixels in the readout order– 0, 2, 4
etc.
• odd_inc
The amount the address counter is incremented for ODD pixels in the readout order – 1, 3, 5
etc.
If the counter is counting down then the above values are used to decrement the address counter.
For non-sub-sampled readout modes both even_inc and odd_inc are set to 1.
The output image size is a function of the size of the addressed region of the pixel array, the sub-
sampling factor and image scaling downscale factor programmed.
It is the responsibility of the host system to calculate the output image size based on the above
parameters and then program the sensor modules x and y output size registers.
Sub-sampling
(x_addr_start, y_addr_start)
and/or
y_output_size
Image scaling
Output
Image
Addressed Data
Pixel Array
Region
(x_addr_end, y_addr_end)
(x_addr_max, y_addr_max)
x_output_size
This gives a minimum border of 4 pixels around the whole pixel array for the colour reconstruction
algorithms to use at the edges of the pixel array (Figure 39).
The addressed region of the pixel array is controlled by the x_start_addr, y_start_addr,
x_end_addr and y_end_addr registers (Table 38).
The start and end addresses are limited to even and odd numbers respectively to ensure that there is
always a even number of pixels readout in x and y.
The limits for the above parameters are given by the x_addr_min, y_addr_min, x_addr_max and
y_addr_max registers (Table 39). From this information the host can automatically determine the
sensor module’s maximum resolution and thus its image format.
The image size programmed by the host should include any border pixels required for the subsequent
image processing algorithms.
Table 39: Pixel Array Address Capability Registers (Read Only and Static)
LS Visible Pixels LE
x_output_size
5.2.3 Mirror/Flip
The sensor module has 2 independent options for altering the readout order of the image data.
Thus the sensor module must support 4 possible pixel readout orders
The application of horizontal mirror and vertical flip readout modes must be re-timed internally to the
start of frame boundary.
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
0 Gr R Gr R Gr R Gr R 0
Direction of Line Readout
1 B Gb B Gb B Gb B Gb 1
2 Gr R Gr R Gr R Gr R 2
3 B Gb B Gb B Gb B Gb 3
4 Gr R Gr R Gr R Gr R 4
5 B Gb B Gb B Gb B Gb 5
6 Gr R Gr R Gr R Gr R 6
7 B Gb B Gb B Gb B Gb 7
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
0 R Gr R Gr R Gr R Gr 0
Direction of Line Readout
1 Gb B Gb B Gb B Gb B 1
2 R Gr R Gr R Gr R Gr 2
3 Gb B Gb B Gb B Gb B 3
4 R Gr R Gr R Gr R Gr 4
5 Gb B Gb B Gb B Gb B 5
6 R Gr R Gr R Gr R Gr 6
7 Gb B Gb B Gb B Gb B 7
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
7 B Gb B Gb B Gb B Gb 7
Direction of Line Readout
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
7 Gb B Gb B Gb B Gb B 7
Direction of Line Readout
The sensor module readout order is controlled via the image_orientation register (Table 41).
Figure 45 illustrates how the above register values can be programmed to sub-sample in x and y by a
factor of 2.
1 3 1 3 1 3 1 3 1 3 1
0 1 2 3 4 5 6 7 8 9 10 11 0 1 2 3 4 5 6 7 8 9 10 11
0 Gr R Gr R Gr R 0
1
1 B Gb B Gb B Gb 1
2 2 Gr R Gr R Gr R
3 1
3 3 B Gb B Gb B Gb
4 Gr R Gr R Gr R 4
1 3
5 B Gb B Gb B Gb 5
6 6 Gr R Gr R Gr R
3 1
7 7 B Gb B Gb B Gb
8 Gr R Gr R Gr R 8
1 3
9 B Gb B Gb B Gb 9
10 10 Gr R Gr R Gr R
3 1
11 11 B Gb B Gb B Gb
• The application of the sub-sample parameters must be re-timed internally to the start
of frame boundary.
• Sub-sampled readout is disabled by setting the odd and even increment values both
to 1
• If the pixel being readout is even (0, 2, 4, etc) then the address is incremented by the
even increment value
• If the pixel being readout is odd (1, 3, 5, etc) then the address is incremented by the
odd increment value.
• Both the even and odd increments values must be odd values.
• The equation for the sub-sampling factor expressed in terms of the even and odd
increments is given below
even _ inc + odd _ inc
sub _ sampling _ factor =
2
• The sensor modules pixel readout order register value must track as the start
address, the end address, the odd address increment and the even address
increment values change.
• The host system when calculating the start address, the end address, the odd
address increment and the even address increment values must ensure that the
CCP2 Data transmitted per line length is a multiple of the correct number of pixels for
the CCP2 RAW data format used. (e.g. 4 pixels for RAW8 and 16-pixels for RAW10).
This is achieved by the host reading the sensor modules frame format description to
determine the fixed number of columns and rows, which are readout in addition to the variable
number of image data row and columns.
• It is the responsibility of the host to update the output image size registers according
to the sub-sampling factors.
The application the frame length and line length parameters must be re-timed internally to the start of
frame boundary.
To aid set-up by host or co-processor the read only and static frame timing parameter limits registers
(Table 48) define the minimum and maximum frame and line lengths possible for that sensor module.
These values are not dependent on x start, y start, x end and y end.
The sensor module does NOT internally clip the frame and line length register values.
It is the responsibility of the host or co-processor to read the minimum and maximum values and
ensure that this range is not exceeded.
Table 48: Frame Timing Parameter Limits (Read only and static)
The frame length and line length register values must be re-timed internally to the start of a frame.
After the CCI message the grouped_parameter_hold register must be reset to 0 to allow the new
frame length and line length values to be applied internally at the next frame boundary.
The image readout time, the time from the CCP2 frame start code for frame n to the CCP2
frame end code for frame n, for this condition is the same as the image readout time for the
sensor module reading out its maximum image size at its fastest frame rate e.g. 1/30th sec.
• The maximum line length in pixel clocks must be sufficient for the line length for the
sensor module reading out its maximum image size at the sensor’s fastest readout
rate, increased by a factor of 4.
FS
FE
FS
CCP Line End Code, LE
CCP Line Start Code, LS
FE
5.4 Relationship between the External Clock Frequency and the Video Timing
and Output Pixel Clock Frequencies
The sensor module contains a PLL (Phase Locked Loop) block, which generates all the necessary
internal clocks from the external clock input.
Figure 49 shows the internal functional blocks, which define the relationship between the external
input clock frequency and the video timing pixel clock frequencies for Profile level 0
CCP
TX
LOGIC
Please note that this is a behavioural description only and does not imply any implementation
In profile 0 the video timing system and pixel clock are also used for the CCP2 transmitter.
Profiles 1 and 2 have separate video timing and output clock domains. This provides a mechanism for
reducing the output peak data rate when using the scaler functionality present in profiles 1 and 2. In
this situation the full resolution of pixel array is still being readout internally at the target video rate e.g.
15fps or 30 fps. When programmable image size is used the output peak data rate can be reduced by
using smaller line_length_pck and frame_length_lines values.
PLL Output Clock Video Timing System Clock Video Timing Pixel Clock
pll_op_clk_freq_mhz vt_sys_clk_freq_mhz vt_pix_clk_freq_mhz
VT Sys VT Pixel
Clock Clock
Divider Divider
External Input Clock PLL Input Clock
ext_clk_freq_mhz pll_ip_clk_freq_mhz
vt_sys_clk_div vt_pix_clk_div
(1, 2, 4, 6, 8,…) (4, 5, 6, 7, 8, 9, 10)
Pre PLL PLL
Clock Multiplier
Divider
Output Timing System Clock Output Timing Pixel Clock
op_sys_clk_freq_mhz op_pix_clk_freq_mhz
pre_pll_clk_div pll_multiplier
(1, 2, 4)
OP Sys OP Pixel
Clock Clock
Divider Divider
op_sys_clk_div op_pix_clk_div
(1, 2, 4, 6, 8,…) (6, 7, 8, 10)
CCP
SCALER TX
LOGIC
Please note that this is a behavioural description only and does not imply any implementation
Table 49 lists the CCI registers, which control the relationship between the external input clock
frequency and the pixel clock frequency.
+
Register Name Type RW Comment
vt_pix_clk_div 16-bit RW Video Timing Pixel Clock Divider Value
unsigned
integer
vt_sys_clk_div 16-bit RW Video Timing System Clock Divider Value
unsigned
integer
pre_pll_clk_div 16-bit RW Pre PLL clock Divider Value
unsigned
integer
pll_multilpier 16-bit RW PLL multiplier Value
unsigned
integer
op_pix_clk_div 16-bit RW Output Pixel Clock Divider Value
unsigned
integer
op_sys_clk_div 16-bit RW Output System Clock Divider Value
unsigned
integer
The AEC/AWB algorithms use the video timing clock division registers to calculate the absolute
exposure/integration time.
The Pre-PLL Clock Divider enables sensor module to divide down an external clock frequency, which
is too high for the PLL into one which lies with the PLL input range.
This greatly increases the range of input clocks the sensor module can work with as well as minimising
the variation in output data rate across the full range of external clock frequencies.
The minimum and maximum limits for the clock frequencies, clock dividers and PLL multipliers in a
sensor modules input clock are fully described by a bank of Read Only CCI registers
Sensor modules must be able to handle any input external clock frequency in the 6.0 MHz to 27 MHz
range.
12MHz Pre PLL 6MHz vt sys clk div=1 vt pix clk div=8
PLL
Clock Multiplier
Divider
16MHz Pre PLL 8MHz vt sys clk div=1 vt pix clk div=8
PLL
Clock Multiplier
Divider
Table 56: Pre PLL and PLL Clock Set-up Capability Registers (Read Only)
Table 57: Video Timing Clock Setup Capability Registers (Read Only)
• To allow the limited range of the pre PLL clock divider values (1, 2, 4, 6, etc) to keep
the PLL input frequency within the min_pll_ip_freq_mhz to 2*
min_pll_ip_freq_mhz range.
This is necessary to minimise the variation in the pixel clock frequency across the full range of
input clock frequencies.
• Allow the readout rate of the sensor module’s full resolution to be smoothly reduced
by at least a factor of 2 from the maximum readout rate e.g. from 30fps to at least
15fps.
• The range for the external clock input frequency is 6.0 MHz to 27.0 MHz
min_ext_clk_freq_mhz = 6.0 MHz
max_ext_clk_freq_mhz = 27.0 MHz
• The maximum PLL input frequency must be at least twice the minimum PLL input
frequency
max_pll_ip_freq_mhz >= 2* min_pll_ip_freq_mhz
• The maximum PLL output frequency must be at least twice the sum of minimum PLL
output frequency and the variation of the PLL output frequency over the full range of
external clock frequencies
max_pll_op_freq_mhz >= 2*(min_pll_op_freq_mhz + var_pll_op_freq_mhz)
or
min_pll_op_freq_mhz <= (max_pll_op_freq_mhz/2)–var_pll_op_freq_mhz
where the variation in the PLL output frequency is
var_pll_op_freq_mhz = 2*min_pll_ip_freq_mhz
• The maximum video timing system clock frequency must be at least twice the sum of
minimum system clock frequency and the variation of the system clock over the full
range of external clock frequencies
max_vt_sys_clk_freq_mhz >=
2*(min_vt_sys_clk_freq_mhz + var_vt_sys_clk_freq_mhz)
or
min_vt_sys_clk_freq_mhz <= (max_vt_sys_clk_freq_mhz/2)–
var_vt_sys_clk_freq_mhz
where the variation in the system clock is
var_vt_sys_clk_freq_mhz = (2*min_pll_ip_freq_mhz)/vt_sys_clk_div
• The maximum video timing pixel clock frequency must be at least twice the sum of the
minimum pixel clock frequency and the variation of the pixel clock over the full range
of external clock frequencies
max_vt_pix_clk_freq_mhz >=
2*(min_vt_pix_clk_freq_mhz + var_vt_pix_clk_freq_mhz)
or
min_vt_pix_clk_freq_mhz <= (max_vt_pix_clk_freq_mhz/2)–
var_vt_sys_clk_freq_mhz
where the variation in the pixel clock is
var_vt_pix_clk_freq_mhz = (2*min_pll_ip_freq_mhz)/
(vt_sys_clk_div*vt_pix_clk_div) )
• 30fps readout for the sensor module’s full resolution shutter with a minimum frame
banking period of 500us. Other readout rates can also be supported.
This 30fps readout is to minimise effects of motion distortion and image tearing in sensor
modules using a rolling blade electronic shutter.
The 1/30th second must be achievable across the full range of external clock frequencies i.e. 6
MHz – 27 MHz
For sensor resolutions whose 30fps bandwidth requirement is beyond the 650Mbps data rate
limit specified in the CCP2 specification, the maximum sensor readout rate may be de-rated.
In this case the sensor must also support the fastest frame rate from the following list which
respects the 650Mbps maximum data rate of CCP2.
Frame Rate List: 30fps, 25fps, 24fps, 20fps, 15fps, 12.5fps, 12fps, 10fps, 7.5fps, 6.25fps,
6fps, 5fps.
• The readout rate of the maximum image size must be able to be smoothly reduced by
a factor of 2 from the maximum readout rate by only changing the PLL multiplier and
the video timing/output system clock dividers.
•
The mechanism for varying the readout rate is via the pre_pll_clk_div,
pll_multiplier, vt_sys_clk_div and op_sys_clk_div registers.
This is necessary to give improved compatibility with the data rate capabilities of different host
CCP2 receiver implementations.
• Sensor modules must be able to work down to a 0ms frame blanking time.
Ideally the host receiver should be able to work a 0ms frame blanking time. However it is
recognised that in many systems this is may not be either practical or possible to achieve this
target.
For compatibility with host receivers requiring more than a 0ms frame blanking time, the frame
length of the sensor module is increased to provide the required frame blanking time.
Thus the sensor module’s frame length parameter allows the frame blanking time to be ‘tuned’
to suit the requirements of the host receiver.
• The sensor video timings are based on the image size readout from the pixel array
and not the image size within the frame of CCP2 output data.
Coarse and fine integration times are based on the timings for the image readout from the
pixel array and not the digitally scaled output.
For this reason the SMIA baseline specification includes a common model for control over sensor
integration time, analogue gain and digital gain. The model is designed to be simple to use without
imposing complicated or inconvenient restrictions on the design of a SMIA sensor.
6.1 Overview
This chapter defines sensor integration time and both analogue and digital gain control in the SMIA
baseline specification. It is split into six sections that define the following aspects:
The coarse_integration_time parameter sets the number of complete sensor line periods of
integration time, fine_integration_time sets an additional number of sensor pixel periods of
integration time (although fine control is an optional feature).
The total integration time of a SMIA sensor can be calculated using the following formula:
integration fine_integration_time
period
setting
Fine integration time control is an option in SMIA. All SMIA sensors must advertise whether they
support it via the static integration_time_capability parameter.
To allow flicker avoidance techniques to be used with a SMIA sensor the exposure control system
must be able to set absolute integration periods. It must, therefore, be possible to determine the
absolute pixel period from details of the external clock frequency and the clock system set-up
parameters.
Five analogue gain controls are defined for a SMIA sensor. One parameter offers control over
analogue gain that is common to all pixels, the other four control possible Bayer-channel dependent
gain.
The gain models supported is advertised by a sensor via the analogue_gain_capability parameter
The global and per channel analogue gain control parameter uses the same coding scheme. The
relationship between the integer gain parameter and the resulting gain is given by the following
equation:
m0 x + c0
gain =
m1 x + c1
where ‘x’ is the integer analogue gain control parameter and m0, c0, m1 & c1 are sensor specific
constants advertised by the sensor. These constants are static parameters and for any one sensor
either m0 or m1 must be zero. The full gain equation therefore reduces to either
c0 m0 x + c0
gain = , or gain =
m1 x + c1 c1
The relationship between the exact timing of a change to the analogue gain control and the resultant
effect on the image stream is covered in Section 6.4.
Limits on the use of the analogue gain control are also advertised by the sensor, for details see
Section 6.7.
If necessary the sensor will delay a gain change so as to affect the output pixel stream at a frame
boundary and, if grouped with other changes, delay it so that all the grouped changes affect the output
pixel stream at the same boundary. See Section 6.5 for more details.
The value advertised as digital_gain_step_size represents the smallest step in digital gain
supported by the sensor. To be a valid SMIA sensor both digital_gain_min and
digital_gain_max must be integer multiples of digital_gain_step_size.
As the same three parameters are used to define all four gain controls the range and precision of the
four gain parameters must be the same.
The four gain control parameters and the static range/precision parameters all use the same unsigned
16-bit fixed-point binary coding scheme where the top eight bits are integer (i.e. 0x0100 = 1.0f, 0x0480
= 4.5f).
A group of parameter changes is marked by the host using a dedicated Boolean control parameter,
grouped_parameter_hold. Any changes made to ‘retimed’ parameters while the
grouped_parameter_hold signal is in the ‘hold’ state should be considered part of the same group.
Only when the grouped_parameter_hold control signal is moved back to the default ‘no-hold’ state
should the group of changes be executed.
While this limit defines a minimum response speed, a sensor designed should, however, aim for a
much faster turnaround time. A delay of 2 field boundaries should be considered more respectable.
Rather than defining a detailed model of exact delays between a parameter change and the
corresponding change to the image stream, the SMIA specification takes a simpler approach that is
designed to be both more flexible and more robust when used with asynchronous hosts (or a host with
other real-time responsibilities).
Control system synchronisation with a SMIA sensor relies on the inclusion of status information within
each image frame. Key to the success of the system is the requirement that in every image frame
each piece of status information that defines the setting of a control parameter _must_ reflect the
setting of that parameter that was used in the generation of that frame (irrespective of consumption
delays).
Using this scheme a control system can always determine which parameter settings were used to
generate any frame. When the host sends a message to the sensor requesting a change in a control
parameter the host can detect at which point the change takes effect by monitoring the status
information.
For details of parameters that are included in this scheme see the CCI register map chapter and the
data format chapter.
In order that the host system can identify these limits automatically the sensor must make the
necessary information available via the serial interface and also include it in the sensor status line.
The SMIA 'exposure control parameter limit discovery process' is designed so that the information that
define the recommended parameter limits for a particular device are independent of all controls
settings and therefore can be fetched early in the set-up process and considered static.
The only downside of this approach is that some of the limits are defined relative to other parameters
(e.g. the maximum integration_time_line setting is defined relative to the number of lines in the field).
These relative limits must therefore be re-evaluated on each change of the video timing set-up.
Parameters that define minimum and maximum recommended settings for each of the integration time
controls and the gain control can be read from sensor serial interface registers. Details of these
registers are given in the table below.
It is possible for a SMIA sensor to be compliant whilst offering no control over analogue gain. This is
achieved by setting both minimum and maximum recommended limits for the analogue gain control to
be the same as the default value of the register. (For details see section 5.)
Limits for the analogue gain controls are simply defined by absolute minimum and maximum
recommended register settings: analogue_gain_code_min and analogue_gain_code_max
The minimum recommended settings for both integration time controls are also defined (registers
fine_integration_time_min and coarse_integration_time_min).
The maximum settings are, however, defined relative to other control parameters. At any time the
recommended maximum fine and coarse integration time limits can be determined using the following
two equations:
fine
valid fine integration time
integration time range ‘max margin’
The maximum time limits are described in this way so that the sensor dependent parameters can be
static and thus only be read once by the host (if instead the sensor advertised the current maximum
legal values the host would have to re-read them each time the line or field length were altered).
7 Colour Matrix
In order to generate common image data from different SMIA sensors, the colour space conversion
required to transform data from the colour space of a particular SMIA sensor to some standard colour
space must be understood.
To this end, the SMIA sensor register map includes some static, read only parameters that should be
used by sensor manufacturers to advertise a recommended colour space conversion matrix. As the
parameters are static a host need only read them once.
The matrix should be derived so as to transform pixel data from the native sensor RGB colour space
to the colour space of sRGB (ITU-R BT.709 reference primaries and a white point of D65, see
http://www.color.org/sRGB.html.
Although it is strongly advised that a recommended matrix should be advertised by a sensor, if for
some reason no a manufacturer does not want to include one they should set the static values in the
matrix parameter registers to represent an identity matrix. Use of this convention allows the simplest
of sensor hosts to 'blindly' use the recommended matrix without corrupting the data.
The following equation shows how the matrix can be used and how the 9 elements of the 3x3 matrix
are named.
The matrix elements are included in the sensor register map as 16-bit fixed-point parameters (16-bit
signed iReals) described more fully in the table below. For details of the 8-bit registers that these
parameters are divided between see CCI register map chapter .
8 Test Modes
To aid the debugging of systems that include SMIA sensors the specification includes a number of test
patterns that each sensor must be able to produce.
Use of these full frame test patterns is controlled by the test_pattern_mode parameter. The following
table shows all the defined parameter settings.
In both the default parameter state and in any undefined parameter states normal array data should be
output rather than a test pattern. The individual test patterns are described later in this chapter.
In each bar all pixels are either 0% or 100% full scale (e.g. 100/0/100/0 bars).
The pattern is made up of 8 vertical bars that fade vertically from one of the 100% colour bar colours
towards a mid-grey at the bottom.
Each of the bars is sub-divided vertically into a left hand side that contains a smooth gradient and a
right hand size that contains a quantised version.
The aim of the quantised portion is to offer areas of flat-field Bayer data that should be large enough to
result in known data values even after de-mosaic (independently of the de-mosaic algorithm).
To ensure maximum dynamic range in the quantised data, the LSBs of the quantised data should be
generated by copying the MSBs of the unquantised data (rather than forcing them to 0).
As the data values of the gradient are most efficiently generated directly from a row counter, arbitrary
vertical size is not always convenient for the fade to grey bars.
As such, the height of each bar should always be a multiple of 128 pixels, the pattern should be
allowed to repeat on any additional lines of image.
The PN9 test pattern is included to ease testing of sensor-link integrity (measurement of bit error rate
etc). PN9 linear feedback shift register has the polynomial X9+X5+1 in Fibonacci type notation (Figure
53).
The PN9 sequence generator should be reset so as to start the sequence in a known state at the first
replaced pixel of each frame.
X9+X5+1
X9 X8 X7 X6 X5 X4 X3 X2 X1 X0=1
D1 D2 D3 D4 D5 D6 D7 D8 D9
The cursors are generated by replacing Bayer pixel data with fixed Bayer data within narrow vertical
and/or horizontal bands of the image. Injection of the test cursors must be arranged such that the
cursors can be superimposed on top of the full frame test patterns as well as array image data.
Two cursors are defined, one vertical cursor and one horizontal. The four parameters described in the
following table are used to control the cursors. The position and width of each cursor can be controlled
manually. Each cursor can be inhibited by setting its width parameter to zero. The vertical cursor can
be put into an ‘automatic position’ mode where it’s position reflects the current value of the sensor
frame counter.
When in its automatic mode the position of the vertical cursor is incremented every frame – the initial
position of the automatic cursor is undefined.
As the size of the frame counter and the image width are not closely coupled in the SMIA specification
some rules must be set to define the exact nature of the relationship.
nFrameCounterBits = 8;
nBitsUsedForCursor = (int) log2(iArrayWidthInPixels);
iPixelsPerStep = 1;
if (nBitsUsedForCursor > nFrameCounterBits) {
iPixelsPerStep = nBitsUsedForCursor – nFrameCounterBits;
nBitsUsedForCursor = nFrameCounterBits;
}
The four registers used to define the output data in solid colour mode also define the Bayer data used
for the image cursors.
9 Image Scaling
9.1 Introduction
Dependent on which profile level a sensor module is compliant with it many have one of 3 different
levels of image scaling capability.
The image scaling function within the sensor module provides a flexible way of generating lower
resolution full field of view image data, at a reduced data rates, for viewfinder and video applications.
The scalers must be able to scale the full resolution of the sensor module down to within 10% of a the
target image size (the smallest output size is 256x192). This flexibility means that SMIA sensor
modules can support a wide range of LCD viewfinder sizes and different codec resolutions
A 10% crop is deemed to be the maximum acceptable error in the field of view of the sensor output
image.
To for fill this is requirement the down scale factor must be programmable in steps of 1/16th.
The host should read scaling_capability register to determine the sensor module’s image
scaling capabilities.
Table 71: Image Scaling Capability Register (Read Only and Static)
Figure 54 illustrates some of the input pixel array sizes and output viewfinder sizes.
UXGA
1600 x 1200
SubQCIF RGB
Viewfinder
128 x 96
12/16/18-bit
QQVGA RGB
Mega Pixel Viewfinder
1152 x 864 160 x 120
12/16/18-bit
VGA
640 x 480
Figure 54: Raw Bayer Data Sizes vs. Example Output Sizes
RAW
Figure 55: Profile Level 0 – Both Software Horizontal and Vertical Scaling on Host system
RAW
Figure 56: Profile Level 1 - Horizontal Scaling in Sensor Module, Software Vertical Scaling on
Host System
RAW
Figure 57: Profile Level 2 - Both Horizontal and Vertical Scaling on Sensor Module
The scaler must support 2 options for the spatial sampling of the scaled image data:
The spatial sampling mode is controlled by the spatial_sampling register (Table 73).
Readout Order:
Spatial Sampling:
Output Order:
Readout Order:
Spatial Sampling:
Co-sited Co-sited Co-sited Co-sited
Line 0 Gr0
R Gr1
R Gr2
R Gr3
R
Line 1 B
Gb0 B
Gb1 B
Gb2 B
Gb3
Line 2 Gr0
R Gr1
R Gr2
R Gr3
R
Line 3 B
Gb0 B
Gb1 B
Gb2 B
Gb3
Output Order:
Readout Order:
Spatial Sampling:
R
B
Gr0
Gb R
B
Gr1
Gb R
B
Gr2
Gb R
B
Gr3
Gb
Line 1
Line 2
R
B
Gr0
Gb R
B
Gr1
Gb R
B
Gr2
Gb R
B
Gr3
Gb
Line 3
Output Order:
For the software viewfinder implementation there are two scaling steps (Figure 61)
• Horizontal
• Vertical
The sensor module performs the horizontal scaling while the vertical scaling may either be performed
in software or by the sensor module if it has full image scaling capability.
The readout order of the scaled output image data must be in the Bayer readout order e.g. Green,
Red, Green, Red, etc or Blue, Green, Blue, Green, etc. As with the non -scaled output modes the
Bayer readout order changes with the horizontal mirror and vertical flip options.
The scaler output is termed quasi Bayer data as while the data is output in a Bayer readout order, the
scaling means that the spatial sampling of the pixel data is not the same as for “true” Bayer data.
The visible quasi Bayer data output by the horizontal scaler is twice the width of the target image size
e.g. for a QQVGA viewfinder the horizontal scaler output is 320 pixels (= 2*160).
Similarly for the full scaler the output is twice the size of the target image size e.g. for a QQVGA
viewfinder the full scaler output is 320 x 240 pixels (= 2*160 x 2*120).
This enables the use of simple viewfinder colour reconstruction algorithms to translate the scaled
quasi Bayer data to display-formatted data.
For example in the case of down scaling a VGA image to a QQVGA viewfinder image the software
takes the 320 x 488 horizontal scaled output image data and uses simple reconstruction algorithms to
generate RGB pixel data (Figure 61). It have to be noticed, when programmable image size is used
the software usually takes 320 x 480 horizontal scaled image data.
In this particular case due to the simple image reconstruction algorithms used for the software
viewfinder implementations there is no requirement for additional border columns.
The horizontal scaler function only affects the horizontal readout of the sensor module. The vertical
readout order of the sensor module does not change when the horizontal scaler function is enabled.
The host system must update the x_output_size and y_output_size parameters as the scaler
parameters change to ensure that only valid scaled image data is output from the sensor module.
Gr R Gr R Gr R Gr R Gr R Gr R Gr R Gr R
Gr R Gr R Rr
G Rr
G
Co-sited Co-sited
Gr R Gr R
V-Scaled Quasi Bayer Pixel Data
R
B
G R
B
G
B Gb B Gb
Co-sited Co-sited
Gr R Gr R
R
B
G R
B
G
B Gb B Gb
G G
R R Co-sited Co-sited
B B
RGB Viewfinder Data
R
B
G R
B
G
Colour reconstruction performed in
software on the host system.
G G
R R Co-sited Co-sited
B B
R
B
G R
B
G
The scaler step size (downscale factor) is programmable from 1.0 up to the scaler step size required
to downscale the maximum addressable width of the pixel array down to an output image width of 256
pixels.
The down scaler factor is controlled by an M/N ratio. M is >= 16 and N is fixed at 16.
scale _ m scale _ m
down _ scale _ factor = =
scale _ n 16
This single down scale factor is used by both the horizontal and vertical scalars.
This provides backward compatibility with hosts that are designed only to support sensor module with
horizontal scalers.
To provide a wider range of data rate reduction options the full image scaler must be able to reduce
the data rates in both the horizontal and vertical directions. This maybe achieved by the use of a FIFO
between video timing and output clock domains (Figure 62).
CCP
ASYNC TX
SCALER FIFO LOGIC
There is single scale factor for the both the horizontal and vertical scalers.
All of the scaler read/write registers (Table 73) must be re-timed within the sensor module to the start
of frame boundary to ensure that the-scaler values are consistent within a frame of image data.
The minimum, maximum and resolution for the M, N components of the down scale and phase
parameters are reported via the image scaling capability registers (Table 74).
Table 74: Image Scaling Capability Registers (Read Only and Static)
16MHz Pre PLL 8MHz vt sys clk div=1 vt pix clk div=6
PLL
Clock Multiplier
Divider
C C
1 Embedded Data Line FE
R
Number of Column Descriptors: 4
Total Number of Cols = 320 + 1 + 1 + 14 = 336
256 Visible Cols 1 MSP Type 1 Col 1 MSP Type 2 Col 14 Dummy Cols
5H 1H 40H 9H 0H 01H AH 0H 01H 2H 0H 0DH
Descriptor 0 Descriptor 1 Descriptor 2 Descriptor 3
1 Embedded Row 8 MSP Type 0 Rows 2 Dark Rows 488 Visible Rows 1 Embedded Row
1H 0H 01H 8H 0H 08H 4H 0H 02H 5H 1H E8H 1H 0H 01H
Descriptor 4 Descriptor 5 Descriptor 6 Descriptor 7 Descriptor 8
Figure 64: Horizontal Scaler Frame Format Example
14 Dummy Cols
1 MSP 1 Cols
1 MSP 2 Cols
LS LE
Visible Pixels
320 x 240
C C
1 Embedded Data Line FE
R
Number of Column Descriptors: 4
Total Number of Cols = 320 + 1 + 1 + 14 = 336
256 Visible Cols 1 MSP Type 1 Col 1 MSP Type 2 Col 14 Dummy Cols
5H 1H 40H 9H 0H 01H AH 0H 01H 2H 0H 0DH
Descriptor 0 Descriptor 1 Descriptor 2 Descriptor 3
1 Embedded Row 8 MSP 0 Rows 2 Dark Rows 240 Visible Rows 1 Embedded Row
1H 0H 01H 8H 0H 08H 4H 0H 02H 5H 0H F0H 1H 0H 01H
Descriptor 4 Descriptor 5 Descriptor 6 Descriptor 7 Descriptor 8
Figure 65: Full (H&V) Scaler Frame Format Example
10 Image Compression
10.1 Introduction
The objective of the image compression is to reduce the required bandwidth in transmission between
the sensor and the host.
• Visually lossless
• Low cost implementation (no line memories are required)
• Fixed Rate compression
Support of the 10-bit to 8-bit DPCM/PCM image compression algorithm specified in this chapter is
mandatory for profile levels 1 and 2. 10-bit to 8-bit compression has the additional advantage that one
pixel value equals one byte of data.
The level of compression is controlled via the CCP_data_format register. The same register is also
used to enable and disable compression.
The compression_mode register is used to select which predictor, simple or advanced, the
compression algorithm uses.
• The 10-bit to 8-bit DPCM/PCM compression only uses the simple predictor.
• The option of simple or advanced predictor is only valid for the optional 10-bit to 7-bit
and 10-bit to 6-bit compression algorithms.
The specified compression algorithm also avoids the false synchronization code generation of CCP2
bus. This property has been implemented so that the coded codeword cannot ever been full of zero
bits and so there can never be more than 14 consequent zero bits in the stream.
When the prediction is good (abs(Xdiff) < Lim) its difference value is quantised and transmitted using
DPCM codec. Otherwise the original value is quantised and transmitted using PCM codec. Of course,
also the selection of the codec has to be transmitted. This selection information is combined together
with DPCM/PCM code words.
The image compression system contains encoder and decoder blocks. In both blocks the similar
prediction method has to be implemented. The block diagram of image compression system is shown
in Figure 66.
Encoder Decoder
Codec
Selector and
Encoder
coded coded
10-bit DPCM1 symbols symbols 10-bit
+
symbols
Σ ... Decoder
symbols
DPCMN
- PCM
M-pixel
Memory
M-pixel
Predictor Decoder
Memory Predictor
Line 0 G0 R1 G2 R3 G4 R5 G6 R7
...
Line 1 B0 G1 B2 G3 B4 G5 B6 G7
... ...
Figure 67:The order of pixels in raw image
This predictor uses only the previous same colour component value as a prediction value. Therefore,
only two-pixel memory is required. The predictor equations can be written as below.
• First two pixels (G0, R1 / B0, G1) in all lines are coded without prediction.
• Other pixels in all lines are predicted using the previous same colour decoded value
as a prediction value.
Xpred(n) = Xdeco(n-2)
This coder offers 20 % bit rate reduction with very high image quality.
Xenco(n) = Xorig(n) / 4
And for avoiding full zero code the following check has been done.
sign = 1
else
sign = 0
12 Register Map
12.1 Introduction
The registers are grouped according to function with each group occupying a pre-allocated region of
the address space. This scheme is purely a conceptual feature and is not related to the actual
hardware implementation.
Any internal register that can be written to can also be read from. There are also read only registers
that contain device status information, (e.g. design revision details).
A read instruction from a reserved or un-used register location must yield the value 0x00.
A write instruction to an unused register location is illegal and the effect of such a write is undefined.
A read or write to an un-used register location must not cause the CCI read or write message to be
aborted. Thus a CCI read or write message to an un-used register location must complete in the same
way as if the read or write message had addressed a used register location.
It is the responsibility of the host system to only write to register locations, which have been defined.
12 13 14 15
8 9 10 11
4 5 6 7
0 1 2 3
Figure 69: Valid 16-bit Indices for the MS Data Byte of 16-bit wide Register
MS Data LS Data
Byte Byte
12 13 14 15
8 9 10 11
4 5 6 7
0 1 2 3
32-bits (4 bytes)
Blue – Valid 16-bit Indices for the MS Data Byte of a 32-bit Wide Register
Red – Valid 16-bit Indices for the LS Data Byte of a 32-bit Wide Register
Figure 70: Valid 16-bit Indices for the MS and LS Data Bytes of 32-bit wide Registers’
Top bits
padded with 9 8 7 6 5 4 3 2 1 0
zeroes
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
Figure 71: Right Alignment for Packing 10-bit Data into 2 8-bit Registers
For a full description of the analogue gain description please refer to the Integration Time and Gain
Control Chapter.
0x0409 Lo
0x040a Hi reserved RW
0x040b Lo
0x1002 Hi Reserved RO
0x1003 Lo
0x1004 Hi coarse_integration_time_min RO Lines
0x1005 Lo Format: 16-bits unsigned integer
0x1082 Hi Reserved RO
0x1083 Lo
0x1084 Hi digital_gain_min RO Minimum recommended digital gain value
0x1085 Lo Format: 16-bit unsigned 8.8 fixed point number
For the RAW6 and RAW7 embedded data formats each byte of data is split into 2 4-bit nibbles.
padded to either 6 or 7-bits respectively and then transmitted over 2 pixels.
For the RAW12 embedded data each byte of data is padded to 12-bits and transmitted as a one pixel.
RAW8:
T7 T6 T5 T4 T3 T2 T1 T0 D7 D6 D5 D4 D3 D2 D1 D0
RAW6:
T7 T6 T5 T4 0 1 T3 T2 T1 T0 0 1 D7 D6 D5 D4 0 1 D3 D2 D1 D0 0 1
Tag Byte split into 2 4-bit nibbles and each Data Byte split into 2 4-bit nibbles and each
nibble padded to 6-bits nibble padded to 6-bits
RAW7:
T7 T6 T5 T4 0 1 0 T3 T2 T1 T0 0 1 0 D7 D6 D5 D4 0 1 0 D3 D2 D1 D0 0 1 0
Tag Byte split into 2 4-bit nibbles and each Data Byte split into 2 4-bit nibbles and each
nibble padded to 7-bits nibble padded to 7-bits
RAW10:
T7 T6 T5 T4 T3 T2 T1 T0 0 1 D7 D6 D5 D4 D3 D2 D1 D0 0 1
RAW12:
T7 T6 T5 T4 T3 T2 T1 T0 0 1 0 1 D7 D6 D5 D4 D3 D2 D1 D0 0 1 0 1
Figure 72: 2 Byte Tagged Data Packet - Data Packing for RAW6, RAW7, RAW8, RAW10 and
RAW12 Data Formats
FS/LS 0H 010 AH 010 T[7:4] 010 T[3:0] 010 D[7:4] 010 D[7:4] 010 T[7:4] 010 T[3:0] 010
FS/LS 0AH Tag[7:0] 0101 0101 Data[7:0] Tag[7:0] 0101 0101 Data[7:0]
The advanced predictor uses four previous pixel values, when the prediction value is evaluated. This
means that also the other colour component values are used, when the prediction value has been
defined. The predictor equations can be written as below.
• 1st pixel (G0 / B0) in all lines is coded without prediction.
• 2nd pixel (R1 / G1) in all lines is predicted using the previous decoded different colour
value as a prediction value.
Xpred(n) = Xdeco(n-1)
• 3rd pixel (G2 / B2) in all lines is predicted using the previous decoded same colour
value as a prediction value.
Xpred(n) = Xdeco(n-2)
This coder offers 30% bit rate reduction with high image quality.
The pixels without prediction are encoded as below.
Xenco(n) = Xorig(n) / 8
And for avoiding full zero code the following check has been done.
value = abs(Xdiff(n) - 8) / 2
if(Xdiff(n) < 0) then
sign = 1
else
sign = 0
value = Xorig(n) / 16
Else
Xdeco(n) = Xpred(n) + value
If (Xdeco(n) > 1023) Xdeco(n) = 1023
The advanced predictor uses four previous pixel values, when the prediction value is evaluated. This
means that also the other colour component values are used, when the prediction value has been
defined. The predictor equations can be written as below.
• 1st pixel (G0 / B0) in all lines is coded without prediction.
• 2nd pixel (R1 / G1) in all lines is predicted using the previous decoded different colour
value as a prediction value.
Xpred(n) = Xdeco(n-1)
• 3rd pixel (G2 / B2) in all lines is predicted using the previous decoded same colour
value as a prediction value.
Xpred(n) = Xdeco(n-2)
This coder offers 40% bit rate reduction with acceptable image quality.
The pixels without prediction are encoded as below.
Xenco(n) = Xorig(n) / 16
And for avoiding full zero code the following check has been done.
else
sign = 0
Else
Xdeco(n) = Xpred(n) + value
14 Additional Examples
14.1 Generic Frame Format Description
C C
FE
R
Number of Column Descriptors: 2
FS
4 Embedded Data Lines
C C
R
Number of Column Descriptors: 2
C C
R
Number of Column Descriptors: 2
C C
R
Number of Column Descriptors: 4
1 Embedded Row 2 Dummy Rows 488 Visible Rows 2 Dummy Rows 1 Embedded Row
1H 0H 01H 2H 0H 02H 5H 1H E8H 2H 0H 02H 1H 0H 01H
Descriptor 4 Descriptor 5 Descriptor 6 Descriptor 7 Descriptor 8
Figure 79: 2-Byte Generic Frame Format Description - Dark Column Based VGA Example 2
FS
2 Embedded Data Lines
Visible Pixels
648 x 488
C C
FE
R
Number of Column Descriptors: 5
3 Dummy Cols 1 MSP Type 1 Col 648 Visible Cols 1 MSP Type 2 Col 3 Dummy Cols
2H 0H 03H 9H 0H 01H 5H 2H 88H AH 0H 01H 2H 0H 03H
Descriptor 0 Descriptor 1 Descriptor 2 Descriptor 3 Descriptor 4
2 Embedded Rows 4 MSP Type 0 Rows 2 Dark Rows 488 Visible Rows
1H 0H 02H 8H 0H 04H 4H 0H 02H 5H 1H E8H
Descriptor 5 Descriptor 6 Descriptor 7 Descriptor 8
Figure 80: 2-Byte Generic Frame Format Description – Dark Row based VGA Example 1
FS
2 Embedded Data Lines
Visible Pixels
648 x 488
C C
FE
R
Number of Column Descriptors: 4
648 Visible Cols 1 MSP Type 1 Col 1 MSP Type 2 Col 6 Dummy Cols
5H 2H 88H 9H 0H 01H AH 0H 01H 2H 0H 06H
Descriptor 0 Descriptor 1 Descriptor 2 Descriptor 3
2 Embedded Rows 4 MSP Type 0 Rows 2 Dark Rows 488 Visible Rows
1H 0H 02H 8H 0H 04H 4H 0H 02H 5H 1H E8H
Descriptor 4 Descriptor 5 Descriptor 6 Descriptor 7
Figure 81: 2-Byte Generic Frame Format Description – Dark Row based VGA Example 2
FS 4 Embedded Data
Lines
LS Visible Pixels LE
256 x 488
C C
4 Embedded Data
Lines FE
R
Number of Column Descriptors: 1
Total Number of Cols = 256
C C
R
Number of Column Descriptors: 3
Total Number of Cols = 256 + 24 + 8 = 288
C C
1 Embedded Data Line FE
R
Number of Column Descriptors: 4
Total Number of Cols = 256 + 1 + 1 + 14 = 272
256 Visible Cols 1 MSP Type 1 Col 1 MSP Type 2 Col 14 Dummy Cols
5H 1H 00H 9H 0H 01H AH 0H 01H 2H 0H 0DH
Descriptor 0 Descriptor 1 Descriptor 2 Descriptor 3
1 Embedded Row 8 MSP Type 0 Rows 2 Dark Rows 488 Visible Rows 1 Embedded Row
1H 0H 01H 8H 0H 08H 4H 0H 02H 5H 1H E8H 1H 0H 01H
Descriptor 4 Descriptor 5 Descriptor 6 Descriptor 7 Descriptor 8
Figure 84 - SubQCIF H-scaler Example 3
FS
4 Embedded Data Lines
LS Visible Pixels LE
320 x 488
C C
R
Number of Column Descriptors: 1
Total Number of Cols = 320
C C
R
Number of Column Descriptors: 3
Total Number of Cols = 320 + 24 + 8 = 352
FS 4 Embedded
Data Lines
Visible Pixels
LS LE
256 x 192
C C
4 Embedded
Data Lines FE
8 Dummy Cols
24 Dark
Visible Pixels
Cols
256 x 192
C C
LS
1 Embedded Data Line FE
14 Dummy Cols
1 MSP 1 Cols
1 MSP 2 Cols
LS Visible Pixels LE
256 x 192
C C
1 Embedded Data Line FE
1 Embedded Row 8 MSP 0 Rows 2 Dark Rows 192 Visible Rows 1 Embedded Row
1H 0H 01H 8H 0H 08H 4H 0H 02H 5H 0H C0H 1H 0H 01H
Descriptor 4 Descriptor 5 Descriptor 6 Descriptor 7 Descriptor 8
Figure 89: SubQCIF Full Scaler Example 3
FS
4 Embedded Data Lines
Visible Pixels
LS 320 x 240 LE
C C
R
Number of Column Descriptors: 1
Total Number of Cols = 320
8 Dummy Cols
24 Dark Cols
LS Visible Pixels LE
320 x 240
C C
R
Number of Column Descriptors: 3
Total Number of Cols = 320 + 24 + 8 = 352
ANNEX