An image acquisition controller structure based on embedded code synchronization

By designing the image acquisition controller structure with embedded code synchronization in the microcontroller, and using the main state machine and secondary state machine to identify the synchronization symbols, the accuracy problem of image data transmission in the camera module is solved, and the embedded code synchronization is realized. Mode support ensures reliable transmission of pixel data.

CN117998027BActive Publication Date: 2024-08-30CHINA KEY SYST & INTEGRATED CIRCUIT
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410150564.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-02
Publication Date
2024-08-30
Estimated Expiration
2044-02-02

AI Technical Summary

Technical Problem

In a microcontroller, how to correctly identify and transmit image data in a camera module that supports embedded code synchronization mode, especially the identification of four synchronization signals: frame start, line start, line end, and frame end synchronization symbols to ensure Reliable transmission of image data.

Method used

An image acquisition controller structure based on embedded code synchronization is designed, including a data synchronization module, a data buffer module and a main control module. The embedded code synchronization register is configured through the AHB bus protocol, and the main state machine and secondary state machine are used to identify The synchronization symbol completes the control of the embedded code synchronization controller and ensures the correct sorting and transmission of pixel data.

Benefits of technology

It achieves reliable and correct transmission of pixel data of camera modules that support embedded code synchronization mode, solves the problems of synchronization signal identification and image data transmission, and improves the applicability and accuracy of the image acquisition controller.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117998027B
    Figure CN117998027B
Patent Text Reader

Abstract

The present invention relates to an image acquisition controller structure based on embedded code synchronization, belonging to the technical field of digital camera image processing, and comprising a data synchronization module, a data buffer module and a main control module. The controller is based on an AMBA system and is a peripheral mounted on an AHB bus. The data synchronization module transfers the pixel data of the pixel clock domain of an external camera to the AHB bus clock domain, completes the data 32 bits sorting, and then sends it to the data buffer module; the data buffer module is a FIFO with a depth of 8 and a bit width of 32 bits, which is used to cache the data sent by the data synchronization module; the main control module includes two state machines and two submodules, which recognize and judge the type of embedded code synchronization symbol currently received, distinguish the vertical synchronization and horizontal synchronization state signals, and complete the pixel data reception control. The controller has a simple structure, reliable transmission, high recognition efficiency, and is suitable for camera modules that support embedded code synchronization mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of digital camera image processing, and in particular to an image acquisition controller structure based on embedded code synchronization. Background Art

[0002] With the rapid development of imaging technology, especially camera modules, higher requirements have been put forward for imaging quality, ease of use and cost-effectiveness. In the process of collecting image data, the microcontroller needs to receive image data from the camera module that supports the embedded code synchronization mode, and complete the image data stream transmission according to the embedded code synchronization symbol embedded in the pixel data stream.

[0003] In the microprocessor, the correct transmission of the camera module requires the correct identification of the synchronization signal. For cameras that support the embedded code synchronization mode, there are four types of synchronization signals: frame start synchronization symbol, line start synchronization symbol, line end synchronization symbol, and frame end synchronization symbol. Therefore, how to correctly identify the synchronization symbol embedded in the data stream and correctly transmit the image data is a problem that needs to be solved. Summary of the invention

[0004] To solve the above technical problems, an image acquisition controller structure based on embedded code synchronization of the present invention is used to acquire pixel data of a digital camera supporting an embedded code synchronization mode, including a data synchronization module, a data buffer module and a main control module;

[0005] The data synchronization module transfers the pixel data in the pixel clock domain to the AHB bus clock domain, completes the data 32 bits sorting, and then sends it to the data buffer module;

[0006] The data buffer module caches the data sent by the data synchronization module before the AHB bus read instruction arrives;

[0007] The main control module adopts the AHB bus protocol and configures the embedded code synchronization symbol register through the AHB interface; according to the embedded code synchronization signal in the identification data stream, the type of synchronization symbol therein is determined to complete the control work of the embedded code synchronization controller.

[0008] In one embodiment of the present invention, the data synchronization module stores pixel data in groups of four 8 bits each in little-endian order to form 32-bit data.

[0009] In one embodiment of the present invention, the data buffer module is a FIFO with a depth of 8 and a bit width of 32 bits, and stores 32-bit data from the data synchronization module.

[0010] In one embodiment of the present invention, the main control module includes a main state machine, a secondary state machine and two sub-modules; the two sub-modules are: a camera_reg module and a camera_irq module; the camera_reg module is used to parse the AHB bus protocol, including all embedded code synchronizer registers, status registers and data registers; the camera_irq module is used to generate an interrupt.

[0011] In one embodiment of the present invention, the main state machine of the main control module includes 6 states:

[0012] IDLE: The main state machine is in idle state, and the image acquisition controller structure capture enable capture_en is disabled; if capture_en capture enable is detected to be valid, the main state machine enters the WFS state;

[0013] WFS: The main state machine is in the waiting frame start state; if it is detected that the data stream contains the frame start synchronization symbol ess_fsc, the main state machine enters the LR state;

[0014] LR: The main state machine is in the row receiving state; the pixel data is sequentially stored in the 32-bit data register through the data synchronization module, and when 32 bits are full, a data valid signal is generated and sent to the data buffer module; if it is detected that the input data is ff, it enters the WLE state;

[0015] WLE: The main state machine is in the waiting line end state; if the synchronization symbol detected at this time is the line end synchronization symbol ess_lec, the main state machine enters the WLS state; if the synchronization symbol detected is the frame end synchronization symbol ess_fec, it enters the FE state;

[0016] WLS: The main state machine is in the waiting line start state; if the synchronization symbol detected at this time is the line start synchronization symbol ess_lsc, the main state machine enters the LR state;

[0017] FE: The main state machine is in the frame end state; if the capture enable is disabled at this time, it enters the IDLE state; if the capture enable is detected to be valid, it enters the WFS state.

[0018] In one embodiment of the present invention, the secondary state machine of the main control module includes 5 states:

[0019] ESS_B0: The secondary state machine is in the state without embedded code; at this time, no valid synchronization symbol is detected. If FF appears in the pixel data, it enters ESS_B1, otherwise it enters ESS_B0;

[0020] ESS_B1: The secondary state machine is in the FF state; at this time, if the next pixel data is detected to be 00, it enters ESS_B2, otherwise it enters ESS_B0 and generates an error interrupt;

[0021] ESS_B2: The secondary state machine is in the FF_00 state; at this time, if the next pixel data is detected to be 00, it enters ESS_B3, otherwise it enters ESS_B0 and generates an error interrupt;

[0022] ESS_B3: The secondary state machine is in the state of detecting FF_00_00; at this time, it automatically enters the next state ESS_B4;

[0023] ESS_B4: The secondary state machine is in the FF_00_00_XY state; at this time, if the next pixel data is FF, it enters ESS_B1, otherwise it enters ESS_B0.

[0024] The above technical solution of the present invention has the following advantages over the prior art: the image acquisition controller structure described in the present invention solves the problem of camera modules supporting embedded code synchronization, and transmits pixel data to a microcontroller through the data structure therein, and has wide applicability; it is used to identify synchronization symbols embedded in pixel data streams, and completes reliable and correct transmission of pixel data according to the type of judgment symbol. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to make the contents of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments of the present invention in conjunction with the accompanying drawings.

[0026] Figure 1 It is a system block diagram of the image acquisition controller based on embedded code synchronization of the present invention;

[0027] Figure 2 It is a schematic diagram of the principle of the embedded code recognition state machine of the present invention;

[0028] Figure 3 It is the jump state diagram of the main state machine of the present invention;

[0029] Figure 4.1 The main state machine jump timing of the present invention is Figure Ⅰ ;

[0030] Figure 4.2 The main state machine jump timing of the present invention is Figure II (Continued). DETAILED DESCRIPTION

[0031] The object of the present invention is to provide an image acquisition controller structure based on embedded code synchronization to solve the problem of a camera module supporting an embedded code synchronization mode transmitting pixel data to a microcontroller.

[0032] To achieve the above functions, Figure 1 As shown, the present invention provides an image acquisition controller structure based on embedded code synchronization, which is used to identify the synchronization symbol embedded in the pixel data stream and complete the reliable and correct transmission of the pixel data according to the type of the judgment symbol. The structure includes a data synchronization module, a data buffer module and a main control module.

[0033] The data synchronization module transfers the pixel data of the camera pixel clock domain to the AHB bus clock domain, completes the data 32 bits data sorting, and then sends it to the data buffer module.

[0034] The data synchronization module is used to complete the synchronization and data sorting of pixel data with a width of 8 bits. The data sorting method is: the first pixel data is arranged in the low position of the data register, and the later pixel data is arranged in the high position of the data register. When the data register is full of 32 bits of data, a data request is generated and sent to the data cache module. After the host receives the data request, it generates a read instruction to read the data in the cache module.

[0035] like Figure 1 The main control module mainly includes a main state machine and two sub-modules; the two sub-modules are divided into a camera_reg module and a camera_irq module.

[0036] The camera_reg module is used to parse the AHB bus protocol, including all embedded code synchronizer registers, status registers and data registers; the camera_irq module is used to generate interrupts.

[0037] For external camera modules that support embedded code synchronization mode, the data format of the synchronization symbol is FF_00_00_XY. Figure 2 It is the embedded code recognition state machine, which has 5 states:

[0038] ESS_B0: The secondary state machine is in the state without embedded code. At this time, no valid synchronization symbol is detected. If FF appears in the pixel data, it enters ESS_B1, otherwise it enters ESS_B0.

[0039] ESS_B1: The secondary state machine is in the FF state. At this time, if the next pixel data detected is 00, it enters ESS_B2, otherwise it enters ESS_B0 and generates an error interrupt.

[0040] ESS_B2: The state machine is in the state of detecting FF_00. At this time, if the next pixel data detected is 00, it enters ESS_B3, otherwise it enters ESS_B0 and generates an error interrupt.

[0041] ESS_B3: The secondary state machine is in the state of detecting FF_00_00. At this time, it automatically enters the next state ESS_B4.

[0042] ESS_B4: The state machine is in the state of detecting FF_00_00_XY. At this time, if the next pixel data is FF, it enters ESS_B1, otherwise it enters ESS_B0.

[0043] When the synchronization symbol is completely detected, it needs to be compared with the configuration synchronization symbol in camera_reg to determine whether the currently received synchronization symbol is one of the four synchronization symbols: frame start, frame end, line start, and line end synchronization symbols. If the judgment result is not any of the four, it indicates that the embedded code synchronization is wrong and a synchronization error interrupt is generated.

[0044] Figure 3 The state diagram for the main state machine jump includes 6 states:

[0045] IDLE: The main state machine is in idle state, and the image acquisition controller structure capture enable is disabled. If capture_en capture enable is detected to be valid, the main state machine enters the WFS state.

[0046] WFS: The main state machine is in the waiting frame start state. If the frame start synchronization symbol ess_fsc is detected in the data stream, the main state machine enters the LR state.

[0047] LR: The main state machine is in the row receiving state. The pixel data is sequentially stored in the 32-bit data register through the data synchronization module. When 32 bits are full, a data valid signal is generated and sent to the data buffer module. If it is detected that the input data is ff, it enters the WLE state.

[0048] WLE: The main state machine is in the waiting line end state. If the synchronization symbol detected at this time is the line end synchronization symbol ess_lec, the main state machine enters the WLS state. If the synchronization symbol detected is the frame end synchronization symbol ess_fec, it enters the FE state.

[0049] WLS: The main state machine is in the waiting line start state. If the synchronization symbol detected at this time is the line start synchronization symbol ess_lsc, the main state machine enters the LR state.

[0050] FE: The main state machine is in the frame end state. If the capture enable is disabled at this time, it enters the IDLE state. If the capture enable is detected to be valid, it enters the WFS state.

[0051] like Figure 4.1 and Figure 4.2As shown, in the image acquisition controller structure of this embodiment, first, the registers are configured through the bus, the frame start character is configured as FF_00_00_D, the frame end character is configured as FF_00_00_A, the line start character is configured as FF_00_00_C, and the line end character is configured as FF_00_00_B. At the rising edge of T2PIXCLK, the capture enable is turned on, capture_en is pulled high, and the main state machine fsm enters the WFS state from IDLE; during T2 to T5, the pixel data is input FF, 00, 00, D in sequence; during T3 to T6, the embedded code recognition state machine recognizes FF, 00, 00, D in sequence, and the state machine jumps from ESS_B0 to ESS_B1, ESS_B2, ESS_B3, ESS_B4 in sequence, and generates an embedded code recognition valid signal; at T5, the last data D of the frame start synchronization is input. At this time, by comparing the bitwise AND with the synchronization symbol in the embedded code synchronization symbol register, an ess_fsc high-level valid signal is generated, indicating that the current synchronization symbol is the frame start symbol; after recognizing the frame start symbol, at the second hclk rising edge at T5, the main state machine is WF The S state enters the LR state, starts to receive data through the data synchronization module, completes the storage in the data register, and sends it to the data buffer module, waiting for the AHB bus to read it; the period from T6 to T11 is the data reception and transmission stage; at T11, the effective data transmission of the pixel data of the current row of the external camera is completed, and then FF is sent, and the main state machine enters WLE, waiting for the end of the row; during T12 to T14, the synchronization character data continues to be received in sequence, and the secondary state machine jumps from ESS_B0 to ESS_B4 in sequence, and compares the synchronization character in the embedded code synchronization character register bit by bit, and generates an ess_lec high-level valid signal, indicating that the current synchronization character is the row end character and the current row transmission is completed; at the second hclk at T14, after the row end character is recognized, the main state machine enters WLS and waits for the start of a new row of data;

[0052] At T15, a new line starts, and the controller receives a new synchronization symbol. During the period from T15 to T18, the controller receives a new synchronization symbol, and the secondary state machine jumps from ESS_B1 to ESS_B4 in sequence to identify the format of the embedded code. After the identification is completed and there is no new embedded code to be identified, this state machine jumps to ESS_B0. At T18, the received embedded code is compared with the synchronization symbol in the embedded code synchronization symbol register bit by bit to generate ess_lsc high level, indicating the start of a new line. At T19, the main state machine jumps from WLS to LR state to receive a new line of pixel data. Between T19 and T24, the data synchronization module receives the pixel data and completes the sorting, generates an output request, and sends it to the buffer module to wait for it to be read by the bus. During the period from T25 to T28, the transmission of valid data of the current row is completed, and the camera module sends the row end synchronization symbol; after receiving the first FF at T25, the main state machine enters WLE at the second hclk, waiting for the row end recognition to be completed; during the period from T26 to T29, the sub-state machine jumps from ESS_B0 to ESS_B4 in sequence, and performs a bitwise AND operation on the received synchronization symbol data and the synchronization symbol in the embedded code synchronization symbol register, and generates an ess_lec high-level valid signal at T28; from T29 to T32, a new row of data arrives, and the camera module sends a row start symbol. The sub-state machine jumps from ESS_B1 to ESS_B4 in sequence, and the main state machine enters the WLS state, waiting for the synchronization symbol to be recognized; the data synchronization module compares the received data with the synchronization symbol in the embedded code in a bitwise AND manner, and generates an ess_lsc high-level valid signal at T32, indicating that a new row has started; at T33, the main state machine jumps from WLS to LR, and then Receive a new row of valid pixel data, complete the sorting in the data synchronization module, generate a data valid signal, and send it to the buffer module to wait for the arrival of the read instruction; in the cycle from T34 to T38, receive valid pixel data and complete synchronization; receive FF at T39, the main state machine enters WLE, and waits for the end of the row; in the cycle from T39 to T42, the camera module completes the last row of valid data of the current frame and sends the frame end synchronization symbol; in the cycle from T39 to T42, the secondary state machine jumps from ESS_B to ESS_B4 in sequence, and the data synchronization module compares the identified embedded code synchronization symbol with the synchronization symbol of the embedded code synchronization symbol register bit by bit, and outputs ess_fec high-level valid signal at T42, indicating that the current frame ends; at the second hclk moment of T42, the main state machine enters the FE state, indicating that the current frame ends; a new frame starts at T43, receives FF, and the main state machine enters WFS to wait for the start of the frame; the judgment logic at subsequent moments is the same as above.

[0053] The camera module based on the embedded code synchronization mode does not have the hardware vertical synchronization signal flag VSYNC and the hardware horizontal synchronization signal flag HSYNC. Therefore, it is necessary to generate the vertical synchronization state sr_vsync and the horizontal synchronization state sr_hsync by identifying and judging the synchronization symbol. In Figure 4, after the ess_fsc flag is recognized at time T5, it indicates that the current stage is the vertical synchronization stage, so sr_vsync is pulled high; at time T14, the ess_lec flag is recognized, and at time T18, the ess_lsc flag is recognized, indicating that the current stage is horizontal synchronization. During the period from T14 to T19, the horizontal synchronization state sr_hsync is pulled high. At time T28, the ess_lec flag is recognized, and at time T32, the ess_lsc flag is recognized. During the period from T28 to T33, the horizontal synchronization state sr_hsync is pulled high. At T42, the ess_fec valid flag is recognized, and at T46, the ess_fsc flag is recognized, indicating that the current stage is the vertical synchronization stage. During the period from T42 to T47, the vertical synchronization flag sr_vsync is pulled high.

[0054] Obviously, the above embodiments are merely examples for clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from these are still within the protection scope of the invention.

Claims

1. An image acquisition controller structure based on embedded code synchronization, used to acquire pixel data of a digital camera supporting embedded code synchronization mode, characterized in that: It includes a data synchronization module, a data buffer module and a main control module; The data synchronization module transfers the pixel data in the pixel clock domain to the AHB bus clock domain, completes the data 32 bits sorting, and then sends it to the data buffer module; The data buffer module caches the data sent by the data synchronization module before the AHB bus read instruction arrives; The main control module adopts the AHB bus protocol and configures the embedded code synchronization symbol register through the AHB interface; according to the embedded code synchronization signal in the identified data stream, the type of synchronization symbol therein is determined to complete the control of the embedded code synchronization controller; The main control module includes a main state machine, a sub-state machine and two sub-modules; the two sub-modules are: camera_reg module and camera_irq module; the camera_reg module is used to parse the AHB bus protocol, including all embedded code synchronization registers, status registers and data registers; the camera_irq module is used to generate interrupts; The main state machine of the main control module includes 6 states: IDLE: The main state machine is in idle state, and the image acquisition controller structure capture enable capture_en is disabled; if capture_en capture enable is detected to be valid, the main state machine enters the WFS state; WFS: The main state machine is in the waiting frame start state; if it is detected that the data stream contains the frame start synchronization symbol ess_fsc, the main state machine enters the LR state; LR: The main state machine is in the row receiving state; the pixel data is sequentially stored in the 32-bit data register through the data synchronization module, and when 32 bits are full, a data valid signal is generated and sent to the data buffer module; if it is detected that the input data is ff, it enters the WLE state; WLE: The main state machine is in the waiting line end state; If the synchronization symbol detected at this time is the line end synchronization symbol ess_lec, the main state machine enters the WLS state; If the synchronization symbol is detected as the frame end synchronization symbol ess_fec, the state enters the FE state; WLS: The main state machine is in the waiting line start state; if the synchronization symbol detected at this time is the line start synchronization symbol ess_lsc, the main state machine enters the LR state; FE: The main state machine is in the frame end state; if the capture enable is disabled at this time, it enters the IDLE state; if the capture enable capture_en is detected to be valid, it enters the WFS state; The secondary state machine of the main control module includes 5 states: ESS_B0: The secondary state machine is in the state without embedded code; at this time, no valid synchronization symbol is detected. If FF appears in the pixel data, it enters ESS_B1, otherwise it enters ESS_B0; ESS_B1: The secondary state machine is in the FF state; at this time, if the next pixel data is detected to be 00, it enters ESS_B2, otherwise it enters ESS_B0 and generates an error interrupt; ESS_B2: The secondary state machine is in the FF_00 state; at this time, if the next pixel data is detected to be 00, it enters ESS_B3, otherwise it enters ESS_B0 and generates an error interrupt; ESS_B3: The secondary state machine is in the state of detecting FF_00_00; at this time, it automatically enters the next state ESS_B4; ESS_B4: The secondary state machine is in the FF_00_00_XY state; at this time, if the next pixel data is FF, it enters ESS_B1, otherwise it enters ESS_B0.

2. The image acquisition controller structure according to claim 1, characterized in that: In the data synchronization module, four groups of 8 bits of pixel data are combined into 32-bit data for storage in little-endian order.

3. The image acquisition controller structure according to claim 1, characterized in that: The data buffer module is a FIFO with a depth of 8 and a bit width of 32 bits, and stores 32-bit data from the data synchronization module.

Citation Information

Patent Citations

  • Video capture controller

    CN101521744A