In today's scientific research and engineering, CCD is increasingly widely used, but its driving pulse and signal acquisition requirements are high, and generally requires a relatively complex microcontroller such as CPLD or DSP to undertake the main control tasks. Compared with single-chip microcomputers, these solutions are more difficult to operate, have a high starting point, and are relatively expensive. However, due to various limitations, single-chip microcomputers rarely have suitable driving and acquisition solutions. Although some published papers have proposed concepts, they are difficult to implement after testing. Therefore, this paper proposes a new solution for using single-chip microcomputers to drive CCDs. This solution is based on the C8051F020 single-chip microcomputer, which can drive CCDs well and at high speed, collect data at the same time, and communicate with computers through RS232 interfaces, reorganize data on computers, and complete functions such as analysis of optical signals. After experiments, this solution has good effects. At the same time, this solution uses Labview to design the human-computer interaction interface, which is highly flexible and can change CCDs into position sensors and other uses as needed.
1 Introduction to CCD
1.1 Basic Principles of CCD
CCD (charge coupled device) is a semiconductor device composed of many neatly arranged capacitors that can sense light and convert images into digital signals. Through the control of an external circuit, each small capacitor can transfer its charge to its adjacent capacitor. Finally, through the control of pulses, the charge of each capacitor is measured one by one to obtain the light intensity value.
1.2 Pins and main parameters of TCD1206 linear array CCD
This design uses the TCD1200D linear array CCD sensor. TCD1200D is a high-sensitivity, low dark current, 2160-pixel linear array CCD image sensor. The sensor can be used for fax, image scanning and OCR. The internal signal preprocessing circuit of the device includes sampling and holding and output pre-amplification circuits. It contains a column of 2160-pixel photodiodes, which can achieve an accuracy of 8 lines/mm (200DPI) when scanning a B4 drawing. Its pins and principles are shown in Figure 1.
Features of TCD1200D linear array CCD sensor:
· Number of image-sensitive units: 2160 pixels
· Image-sensitive unit size: 14×14×14 μm (center distance between adjacent pixels is 14 μm)
· Photosensitive area: High-sensitivity PN junction is used as the photosensitive unit
· Clock: Two-phase (5V)
· Internal circuit: Contains sample-and-hold circuit, output pre-amplifier circuit
· Package form: 22-pin DIP package. [page]
This type of CCD driver needs to send SH, φ1, φ2, RS and other pulses, and the acquisition requires differential OS and DOS signals. The specific pulse requirements are shown in Figure 2.
Among them, SH is the integration pulse. When it is high level, the CCD pixel starts to accumulate charge, and when it is low level, it stops accumulating; φ1 and φ2 are two inverted driving pulses, whose main function is to control the transfer of charge; RS is the signal trigger pulse, each falling edge will trigger a pixel to release charge, thereby outputting the electrical signal; OS is the output signal, after 13 dummy outputs and light shielding output, the useful signal is output; DOS is the reference level signal, after differential with OS, the final signal output is obtained. These pulses require high frequencies (for example, the typical frequency reference value of RS is 1 MHz), and the matching requirements are high, so it is difficult to complete the operation of general single-chip microcomputers.
2 Hardware circuit design
As shown in Figure 2, the CCD driver needs to send 4 driving pulses including SH, φ1, φ2, RS, etc., among which the frequency range of RS is 0.02MHz to 2MHz, and the typical value is 1MHz. This high-frequency pulse is difficult for a single-chip microcomputer to complete independently, so this system uses a certain digital circuit for auxiliary design. At the same time, since the maximum value of the A/D conversion of the C8051F020 microcontroller is 500kHz, and the frequency of the analog signal sent by the CCD (i.e., the frequency of OS) is the same as RS, the frequency of RS is also selected as 500kHz.
The specific plan is to use the PCA module of the microcontroller to send a stable 1MHz square wave pulse, and then divide it twice through the D flip-flop (74HC74 chip) to obtain 5V, 0.5MHz and 0.25MHz square wave pulses (both frequencies have two pulses with opposite levels), of which the 0.5MHz pulse is used as the RS driving pulse, and the two 0.25MHz pulses are used as the pulses of φ1 and φ2 respectively. At the same time, timer 2 is used to detect RS, count, determine the integration time of SH, and send the SH pulse that meets the requirements. At the same time, the SH pulse requires an inverter to convert the level (3V~5V) and send the control pulse of the D flip-flop. For the acquisition of DOS, this system uses a subtractor and follower built with OP27 for acquisition.
The pulse control and signal A/D conversion of CCD are mainly completed by C8051F020 microcontroller. As mentioned above, TX0 and RX0 are configured at P0.0 and P0.1 for RS232 communication; 1 MHz stable square wave pulse is sent by P0.2 port (PCA); P0.3 (T2) counts RS (0.5 MHz); A/D conversion trigger control bit (CNVSTR) is connected to pin P0.4; P0.5 is controlled by timer 2 to send SH pulse; P1.1 is an analog input port to receive analog signals.
[page]
3 Human-computer interaction interface software design
The software design of this system includes the application program of the C8051 microcontroller and the Labview application program of the human-computer interaction interface.
The program flow chart of C8051 microcontroller is shown in Figure 3. After the initialization of PCA, ADC and other functions is set up with the hardware, the CCD data is read and stored in the XDATA space until the information sent by the computer is received. After the acquisition of one cycle of data is completed, the A/D conversion is turned off, and it is determined whether the information sent by the computer requires the entire waveform to be sent or the position judgment is performed (this design also includes a function of judging the extreme value, leaving an interface for position sensing). If it is the former, all data are sent to the serial port buffer; if it is the latter, the maximum value of the mountain conversion data is determined, and the position signal of the maximum value is started and sent to the serial port. After a series of processes, the acquisition is restarted, and the cycle continues.
Labview uses the graphical G language for programming to complete the functions of the human-computer interaction interface software. The software can realize the real-time acquisition of the entire waveform and position information, the preservation and reading of historical data, and the control of the start, stop and reset of the entire system. Figure 4 is the program flowchart of Labview.
4 Experimental results
4.1 Physical picture of the circuit board
This solution has been fully implemented and tested. The effect is good and can meet basic scientific research detection or demonstration teaching tasks. The following is a circuit board that has been successfully made.
[page]
4.2 Single-slit diffraction testWhen light passes through a tiny single slit, and the slit width is equal to the wavelength of the light source, an obvious diffraction phenomenon will occur, that is, the light will change its linear propagation and propagate according to a certain law. Under ideal conditions, a single-slit diffraction will show a specific spectrum on the light screen, with the brightest stripe in the middle, gradually weakening to both sides, and dark stripes with no light at all. Figure 6 is the test pattern. The upper part is the light intensity waveform corresponding to the voltage value collected after calibration, which is completely consistent with the theory; the lower part is a simulation of the actual situation using Labview's two-dimensional light intensity control, which is consistent with the pattern observed by the naked eye.
5 Conclusion
This article provides a complete solution for collecting CCD signals with a single-chip microcomputer, and introduces the software and hardware in detail. Its novelty is that the drive pulse is generated by the PCA that does not occupy memory, in conjunction with the D flip-flop and the timing counter. In summary, the C8051f020 single-chip microcomputer can complete this task because it supports a 16-bit PCA module, 2 timing counters of more than 12 bits, more than 2k internal data RAM, an 8-bit high-speed ADC with multiple triggering modes, and a UART serial port. Any microcontroller with the same analog peripherals can complete this solution, and the PCA module can be replaced by an active crystal oscillator. If the built-in RAM is insufficient, it can be supplemented by external memory. There are also many 8-bit ADC chips on the market, and most single-chip microcomputers also have timing counters of more than 12 bits, so this method can be fully promoted and applied, and it is a universally applicable application solution.
Previous article:Single chip microcomputer and FPGA to achieve equal precision frequency measurement and IDDS technology design scheme
Next article:Design of audio mouse repellent based on 51-chip microcomputer
Recommended ReadingLatest update time:2024-11-17 00:53
- Popular Resources
- Popular amplifiers
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Arduino Nano collects temperature and humidity data through LabVIEW and DHT11
- Modern Testing Technology and System Integration (Liu Junhua)
- Computer Control System Analysis, Design and Implementation Technology (Edited by Li Dongsheng, Zhu Wenxing, Gao Rui)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Research and FPGA Design of Image Scaling Algorithm
- EEWORLD University ----TI sports camera and handheld stabilizer solutions
- Is there a formula to calculate the distribution of magnetic field strength in space for a 4mm diameter (3mm) magnet?
- [Beetle ESP32-C3 review] Part 3: vscode+idf+oled+ssd1306+dht11
- Single-ended flyback power supply winding turns problem
- [RVB2601 Creative Application Development] 8. Analysis of RVB2601 Sound Recognition Code
- Pioneer Semiconductor|Introduction to Ultra-Low Power MCU Mode
- MCU ultra-low power consumption ULPMark-CP benchmark ranking
- [NUCLEO-L452RE Review] + FREERTOS (CMSIS-RTOS) Event
- Application guide of small power supply in optical module