In the working area of 4MV electrostatic accelerator, a large-scale nuclear radiation monitoring system needs to be established. The multi-channel pulse amplitude analysis system is the key. The peak value of the pulse width signal (1-2µs) output by the gamma-ray detector is collected and analyzed, and the collection rate must be greater than 1MS/s.
Currently, most similar systems use C51 series microcontrollers (89C51) as the main controller. Since the machine cycle of the C51 series microcontrollers is 12 clock cycles and the instruction execution rate is only 1MIPS when the operating frequency is 12MHz, its slow speed affects the acquisition and data transmission rate of the multi-channel pulse analysis system.
The first major feature of the system we designed is that it uses the most powerful ATmega128 in the AVR microcontroller series to replace the C51 series microcontroller, which increases the system's operating speed by dozens of times and the acquisition rate can reach 5MS/s. The second major feature is that in order to solve the problem of slow communication with the host computer, USB interface technology is used to achieve a data transmission rate of 1Mbit/s. Therefore, the system fundamentally meets the requirements of nuclear power signals for high acquisition speed and large communication capacity. The advantages of USB, such as plug-and-play, strong versatility, easy expansion, and high reliability [2], have also greatly improved its usage characteristics.
1 ATmega128 working principle and characteristics
ATmega128 is the most powerful microcontroller in the AVR series. It uses the Harvard architecture concept and has a pre-fetch instruction function, that is, the program storage and data storage have different memories and buses. When a certain instruction is executed, the next instruction is pre-fetched from the program memory, and the program execution efficiency is high [3]. The timing diagram of ATmega128 instruction execution is shown in Figure 1.
Its machine cycle is 1 clock cycle, most instructions are single-cycle instructions, and it can achieve 16MIPS performance at an operating frequency of 16MHz. It can generate a square wave with a cycle of 125ns (frequency of 8MHz) as the clock signal of the high-speed analog-to-digital conversion circuit, which is 20 to 30 times faster than the C51 microcontroller.
2 Structural Principle of ATmega128 Controlled Multi-Channel Pulse Amplitude Analysis System
The multi-channel pulse amplitude analysis system with AVR single-chip microcomputer ATmega128 as the control core is mainly composed of program-controlled amplifier circuit, threshold circuit, peak hold circuit, high-speed analog-to-digital conversion circuit, memory expansion circuit and USB interface circuit. The system structure block diagram is shown in Figure 1
Figure 1. Block diagram of multi-channel analysis system
The gamma-ray detector is made of (Φ40×40)mm NaI(Tl) crystal, which is packaged with PMT (photomultiplier tube) and preamplifier
. The output voltage pulse proportional to the detected energy is amplified by program control, and then enters the peak holding circuit after passing through the threshold circuit. Under the control of ATmega128, high-speed analog-to-digital conversion is completed and sent to the extended memory. When the PC issues a data read instruction, the collected data is transmitted to the PC through the USB interface.
2.1 Programmable Amplification and Threshold Circuit
The programmable amplifier circuit uses a high-speed (bandwidth of 170MHz) and low-drift operational amplifier AD9631. The output resistance of the X9241M (digital potentiometer) with an I2C bus interface is adjusted by ATmega128 to change its amplification factor. The main purpose is to regularly measure the peak position change of the characteristic peak of the standard radioactive source (such as the characteristic peak of 137Cs is the full-energy peak of 662keV gamma rays) - the "channel number" of peak position drift, and adjust its magnification to stabilize the peak position of the characteristic peak [4].
The threshold circuit is composed of a high-speed and accurate voltage comparator AD790 (response time is 45ns), X9241M and a reference source. ATmega128 adjusts the output resistance of X9241M to set its lower threshold voltage and eliminate the low-noise signal output by the detector.
2.2 Peak hold and high-speed analog-to-digital conversion circuit
The voltage pulse signal representing the energy of gamma-ray radiation is very narrow, with a width of about 1 to 2µs, and cannot be directly converted to A/D. It can only be quantified after its peak value is expanded. The peak hold and high-speed analog-to-digital conversion circuit controlled by ATmega128 is shown in Figure 3. The peak hold circuit is composed of ADG721 and AD790. ADG721 is a high-speed COMS switch, which is effective at high level. It takes 24ns to close the switch and 11ns to open it. [page]
Peak hold principle: At the beginning, ATmega128 controls switch K1 to close and K2 to open. The output voltage of U1 is divided into two paths, one of which charges the 100PF capacitor C1 through a diode; the other is sent to the voltage comparator U3 and compared with the output voltage of the emitter follower circuit U2. When the output voltage of U2 is greater than the output voltage of U1, the voltage held by capacitor C1 is the peak voltage. After receiving the interrupt signal (INT2) from U3, ATmega128 controls switch K1 to open, starts the high-speed analog-to-digital conversion circuit to collect and store it, and then controls switch K2 to close and discharge capacitor C1. Finally, control switch K1 to close and K2 to open to prepare for collecting the next γ event peak. Capacitor C1 is a mica capacitor with extremely high anti-leakage capability, so it can maintain the peak value of narrow pulse signals.
In the high-speed analog-to-digital conversion circuit, AD9220 is a 12-bit high-speed analog-to-digital converter with excellent performance from ADI, with a rate of up to 10MSPS[5]. The internal reference source is selected and the sampling is performed using a single-ended input method. One sampling requires one clock cycle, and its rate depends on the frequency of the input clock. The voltage input range is 0 to 5V.
ATmega128 uses a 16MHz crystal oscillator with a machine cycle of 62.5ns. Through software programming, a square wave with a cycle of 125ns is generated at the PD5 port as the clock signal (CLK) for AD9220 sampling. Since ATmega128 also needs to store data after each sampling, the data storage time requires 62.5ns. Therefore, it takes a total of 187.5 ns to obtain each data. Tests have shown that the use of ATmega128 successfully makes up for the shortcomings of the slow speed of 89C51 and gives full play to the performance of high-speed analog-to-digital conversion of AD9220, with a conversion rate of 5MS/s.
Since ATmega128 only has 4K data memory inside, when the amount of data collected is greater than 4K, 62256 (32K) is used to expand the external data memory.
2.3 USB interface circuit and software design
CH375 is used as the USB controller. It is a universal device interface chip of the USB bus. It has a built-in underlying protocol for USB communication, supports host mode and slave mode, and has an 8-bit data bus (D0-D7), address input (A0), read (RD#), write (WR#), chip select control line (CS#) and interrupt output (INT#). It is connected to
the data bus of ATmega128 as a slave to communicate with the host computer [6]. The interface circuit between CH375 and ATmega128 is shown in Figure 4.
Figure 4 USB controller CH375 and ATmega128 interface circuit
On the local side, the slave mode CH375 adopts the built-in firmware mode. ATmega128 operates CH375 in the I/O mode of command plus data. Any operation is to send a command to CH375 first (its command format is referenced in reference 6), and then perform data input and output. After CH375 receives the data sent by the computer or sends the data, it notifies the microcontroller in an interrupt mode.
On the computer side, VC is used as the development platform for computer-side application software, and the API functions provided by the CH375 dynamic link library DLL are used to operate it. After copying the driver and dynamic link library of the CH375 chip to the computer, and then adding the access entry and function definition entry of the dynamic link library to the VC project, the communication programming of the USB device is almost the same as accessing files in the local hard disk.
3 Full Energy Peak Measurement
The full energy peak obtained by the system for detecting 137Cs is shown in Figure 4. The lower threshold voltage of the threshold circuit is set to 0.5V. The horizontal axis is energy, divided into 4096 channels, and the vertical axis is the count value of each channel. From this figure, it can be concluded that the half-height width of 137Cs is 171, the energy resolution is 8.09%, and the maximum count of the 662KeV gamma-ray spectrum peak is 3395, and the corresponding number of spectral lines is 2115.
4 Conclusion
The system uses AVR ATmega128 as the main controller and USB bus for data transmission, with high counting rate and short dead time. It not only has the advantages of high acquisition rate (5MS/s), but also has the advantages of fast transmission speed (1Mbit/s), easy to use, scalable, fast, reliable transmission, etc. It has been applied to the nuclear radiation protection monitoring system of our school's 4MV electrostatic accelerator.
Previous article:Practical car air conditioning controller circuit based on Atmega8
Next article:Research and implementation of wireless sensor network nodes based on ATmega128L and CC2420
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
- [LPC] [Help] I have a problem now. I want to use the LPC1768 MCU hardware I2C interrupt to drive the OLED
- Looking for Samsung DDR3eMMC Datasheet
- Taking the core-G1 [STM32F103C8T6] core board marquee experiment introductory series 1 project as an example, this paper introduces STM3...
- MCP2517 (SPI to CAN) debugging record
- Analysis of the Causes of Hall Switch Damage
- Schematic diagram error solution
- ESP32, Micropython serial port send write() usage problem - thank you!
- Vernacular Big Data and Machine Learning
- CC1310/CC1350 with TI-RTOS operating system Sensor, Collector routine frequency hopping mode communication details
- Newbies learning 51 MCU, online help