O Introduction
Due to the continuous development of embedded system application technology, the requirements for core processor performance are getting higher and higher. Some traditional 51 series control chips are no longer competent for many complex tasks. Therefore, through research and analysis, we have developed a set of experimental development systems based on ATmega8 high-performance series microcontrollers. ATMEL's ATmegs8 microcontroller is an 8-bit RISC CPU with a unique structure. Its online self-programming Flash and single clock instructions, instruction system settings optimized for C language and Basic language, and rich on-chip peripheral interface circuits make the powerful ATmegs8 microcontroller a highly flexible and cost-effective chip, providing an excellent solution for many high-end embedded system designs.
1 System overall design
The overall design principle block diagram of the single-chip multi-function experimental instrument hardware is shown in Figure 1:
In the single-chip microcomputer experimental development application system, the ATmega8 MCU core module communicates with the PC host computer through RS-232, making full use of the PC's resources. The power supply part uses USB to connect to the PC and uses the power supply of the host computer. In addition, the experimental development system is designed with a downloader, which only needs a download line to start working, without the need to purchase an expensive programmer, which is easy to use and saves costs. It can ensure that the experimental system has a high cost performance.
In the experimental software, both C language and BASCOM-AVR programming software can be used. BASCOM-AVR programming software provides a powerful, simple and convenient software platform for the development of AVR single-chip microcomputers. Its BASIC language, which is highly compatible with QB, is easy to understand and learn; the fully functional hardware simulation platform makes the learning, experimentation, and development of single-chip microcomputers simple, easy and fun, and the results of many designs can be known in computer simulation. With BASCOM-AVR, it is possible to popularize AVR single-chip microcomputers on a large scale, providing excellent solutions for many high-end embedded system designs. [page]
2 Hardware Circuit Design
2.1 Design of CPU Module
ATmegs8 is a new AVR high-end microcontroller launched by ATMEL in the first quarter of 2002. ATmegs8 integrates rich hardware interface circuits and two 8-bit timer/counters with separate prescalers in comparison mode. 1 prescaler, 16-bit timer/counter with comparison and capture mode, 1 asynchronous real-time clock (RTC) with independent oscillator, 3 PWM channels, which can realize any PWM pulse width modulation output with adjustable phase and frequency <16 bits, 8-channel A/D conversion (TQFP, MLF package), 6-channel 10-bit A/D + 2-channel 8-bit A/D, 6-channel A/D conversion (PDIP package), 4-channel 10-bit A/D + 2-channel 8-bit A/D, 1 I2C serial interface, supporting master/slave, transceiver and four working modes, supporting automatic bus arbitration, 1 programmable serial USART interface, supporting synchronous, asynchronous and multi-machine communication automatic address recognition, 1 SPI synchronous serial interface supporting master/slave, transceiver and receive, programmable watchdog timer with on-chip RC oscillator, on-chip analog comparator. The CPU module designed around the core chip is shown in Figure 2.
The reset circuit RESET in the figure has two options: external reset, J10 must be plugged into a short-circuit block; or PC6 is used as an I/O port, and J10 is unplugged from the short-circuit block.
The crystal oscillator circuit XTAL1 and XTAL2 in the figure are the input and output ends of the reverse amplifier of the on-chip oscillator, respectively. An external crystal oscillator is connected. By programming the fuse bit CKOPT and setting the value range of C9 and C10 (12μm~22μm), ATmega8 has a wider operating frequency range (3.0 MHz~8.0 MHz). There are two options for the crystal oscillator: an external 8 MHz passive crystal oscillator (an external 8 MHz active crystal oscillator can also be connected. When the external passive crystal oscillator cannot start oscillation, the active crystal oscillator can solve the problem and can also start oscillation with overclocking), or an internal RC oscillator. When J11 and J12 are plugged into short-circuit blocks, an external passive crystal oscillator is used; when J11 and J12 are not plugged into short-circuit blocks, the internal oscillator of ATmega8 is used.
In addition, the module is also designed with JTAG interface and ISP programming interface (ISP stands for in-System Programmable). The JTAG interface can connect the microcontroller to the parallel interface of the microcomputer through a downloader. The ISP programming interface is used to download or read the internal program of the chip online. The meaning of each pin is shown in Figure 3. Among them, pin 1 is connected to PB3 of ATmega8. 4, 6, 8, and 10 are grounded, pin 5 is connected to PC6 of ATmega8, pin 7 is connected to PB5 of ATmesa8, and pin 9 is connected to PB4 of ATmega8.
2.2 Downloader Module
The downloader consists of an interface board and a connecting cable. The schematic diagram of the interface board is shown in Figure 4. In the figure, U201 is an 8-buffer 74HC244 circuit, which is used as a buffer isolation between the computer parallel port and the microcontroller. Connector CN202 is a universal DB25 pin plug, which is connected to the host computer for communication; pins 4 and 5 control the U201 chip, allowing data to be transmitted normally when it is low, and the output of 74HC244 is in a high-impedance state when it is high; pin 7 outputs data to the microcontroller; pin 6 is a clock signal; pin 9 is an output reset signal; and pin 10 is used to receive data read from the microcontroller. The download cable uses a 10-core flat cable with IDC plugs pressed on both ends. One end is connected to the downloader, and the other end is connected to the ISP port JP1 on the minimum system board.
[page]
2.3 Other circuit designs of the experimental instrument
2.3.1 A/D conversion circuit
Figure 5 shows the A/D conversion circuit. There is a 10-bit A/D converter inside ATmega8, with an accuracy of ±2LSB, a nonlinearity of 0.5 LSB, and a conversion time of 65μs to 260μs. The conversion accuracy of the PC0 to PC3 analog input channels is 10 bits, and the conversion accuracy of the PC4 to PC5 analog input channels is 8 bits. This experimental instrument uses PC5 input, and the reference voltage Vref uses the reference voltage provided inside the chip. Using capacitors C5 and C6 to ground the pins externally can improve the anti-interference ability of the ADC part. The input voltage can be changed by adjusting W1. CZ4 is the external A/D conversion interface.
[page]
2.3.2 LED display and pulse width modulation circuitIn order to meet the basic I/O port design requirements of students, the experimental instrument is expanded with LED/LCD display interface circuit and pulse width modulation circuit, as shown in Figure 6.
The pulse width modulation circuit uses an output terminal OC2 of the ATmega8 microcontroller, which is the second function of the PB3 pin and can be used as a comparison match output or PWM output. Disconnecting the jumper J6 on the experimental board is the PWM output. In addition to directly driving the PWM drive signal of the DC motor, the output PWM can also be used for digital/analog conversion after RC smoothing filtering. In addition, using PWM drive, the power consumption of power semiconductor devices is much lower than that of analog signal drive.
2.3.3 Design of I2C circuit and serial interface
The I2C circuit is formed by connecting the AT24C02 chip with the serial TWI bus (PC4, PC3). Among them, PC4 is the SCL clock line, PC2 is the SDA data line, and the I2C bus 1/4 is formed through the AT24C02 chip (Figure omitted). The serial interface circuit is divided into the communication interface with the PC and the communication interface between the two single-chip microcomputers, see CZ3 (CON3 single-chip microcomputer serial communication interface) and CZ4 (CON2 single-chip microcomputer and PC serial communication interface) in Figure 7. CZ2 is an RS232 interface, which can be used for asynchronous serial UART communication between the PC and ATmega8. The PC screen can be used as a user display terminal, which can make full use of PC resources.
When using this interface to communicate with a microcomputer, an RS-232 interface line is used. RS-232 is a single-ended signal transmission, which is suitable for short-distance or modem communication.
After the above circuit design, the PCB board is made according to the circuit principle, and the corresponding components are welded and debugged to form the experimental instrument hardware development board as shown in Figure 8.
3 BASCOM-AVR integrated development software
ATMEL's AVR series of single-chip microcontrollers are based on the new reduced instruction RISC structure. The purpose of its development is to be able to use high-level language programming, so as to efficiently develop target products. At present, many companies in the world have launched AVR development software and platforms based on high-level programming languages such as C and Basic.
The BASCOM-AVR development platform based on the ATmega8 experimental development board uses the BASIC language as a means to develop a platform. Its program design is simple and convenient, dedicated to various general interfaces, and has powerful statements, physical graphical simulation platform and other characteristics. With the advantages of the AVR single-chip microcontroller program memory that can be programmed multiple times and downloaded online, it makes it very easy to learn and use the AVR single-chip microcontroller.
4 Summary and Outlook
Based on the ATmega8 single-chip microcomputer experimental instrument, LCD display module, LED digital tube display module, keyboard module, A/D and D/A conversion module, general I/O interface module, communication interface module and other common experimental modules are integrated. The basic experimental system developed by AVR single-chip microcomputer can complete some basic experiments and meet the requirements of students' basic experiments. At the same time, there is an expandable space between the boards to meet the practical training requirements of students' innovative design, comprehensive course design, extracurricular science and technology activities and graduation design courses. The experimental system has been tried by students of the 2007 and 2008 grades of the mechanical and electrical majors and the 2007 and 2008 grades of the electronic technology majors, and the effect is quite significant. It not only realizes the move of the laboratory into the dormitory, but also stimulates students' interest in learning, cultivates students' hands-on ability and innovation ability, and lays a solid foundation for rapid adaptation to jobs in the future.
Previous article:Design and implementation of fire-fighting robot based on AVR microcontroller
Next article:Design of digital sinusoidal inverter power supply based on AVR microcontroller
Recommended ReadingLatest update time:2024-11-16 16:39
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
- Intelligent Control Technology of Permanent Magnet Synchronous Motor (Written by Wang Jun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
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
- How is this kind of PCB wiring designed using AD? Please give me some guidance, masters!
- EEWORLD University ---- Quartus Prime Development Process (Intel Official Tutorial)
- Issues with STM32L15xCC
- Access control panel with Bluetooth low energy and capacitive touch technology
- The eighth chapter of the Altera series of the struggling child of Zhixin Technology: Verilog basic syntax.pdf
- VDA6.7-CN (Process Audit)
- TI DSP command file CMD
- [A-Current Signal Detection Device] Sichuan Province-Second Prize
- IoT Smart Lights
- The problem of static electricity