Based on the characteristics and applications of ATmega162

Crystal oscillator
Quartz Oscillator 3225 20M OSC

1 Introduction

The ATmega 162 is an 8-bit microcontroller based on AVRRISC's low-power CMOS from ATMEL. By executing an instruction in one clock cycle, the ATmega 162 achieves performance close to 1 MIPS/MHz, allowing the juicer to strike a balance between power consumption and execution speed. The AVR core connects 32 general purpose working registers with a rich instruction set. All working registers are directly connected to the ALU arithmetic logic unit, allowing a single instruction to be executed in one clock cycle while accessing two separate registers. This structure improves code efficiency and gives AVR nearly 10 times better performance than a normal CISC microcontroller. This paper uses ATmega 162 to develop a keyboard-liquid crystal display, a two-phase DC brushless motor without position sensor and an asynchronous serial communication port to realize data acquisition and transmission. Experiments show that these systems developed with ATmega 162 have reliable performance, low cost, flexible software design, and rich hardware interface functions, which have created favorable conditions for future system upgrades.

2 ATmega162 structure and characteristics

The ATmega162 features 35 programmable I/O lines, 40-pin PDIP, 44-pin TQFP and 44-pin MLF. Four 8-bit bidirectional I/O ports A, B, C, D, a 3-position bidirectional I/O port with internal pull-up resistors. Each port has three corresponding I/O port registers, which are data register PORTx, direction register DDRx, and input pin register PINx. When DDxn is written to 0, the corresponding Pxn is configured as an input pin. When PORTxn is set to 1, the internal pull-up resistor configured for this pin is valid. When DDxn is 1, the corresponding Pxn is configured as an output pin, and the data in PORTxn is the output level of the external pin, which is 1, the port pin is forcibly driven high, and the output is high (output current); Clear PORTxn, the port pin is forced low, and the output is low (sink current). During the reset process, the port is a three-state port even if the system clock has not been started. It can also be used as an address/data multiplexer to provide many special interface functions of the ATmega162. Port C provides the functionality of the JTAG interface. The internal pull-up resistors for pins PC7 (TDD, PC5(TMS), and PC4(TCK) are always in active mode (including reset) while the JTAG interface is enabled.

ATmega162 has the following features: 16 kB in-line programming FLASH with literacy; 512 B E2PROM; 1 kB SRAM memory; 35 general purpose I/O ports; 1 external memory interface; 32 general working registers; JTAG interface for boundary scan function; support online compilation, programming and simulation debugging; support programming of FLASH, E2PROM, chip fuse and security lock bits; 4 flexible timer/counters with comparison mode, 2 with comparison Mode 8-bit timer/counter with prescaler, 2 prescalers, 16-bit timer/counter with compare and capture modes, real-time counter with independent oscillator; 6 PWM channels; internal and external Interrupt source; power-on reset and programmable voltage detection circuit; internal calibratable RC oscillator; 2 programmable UART interfaces; programmable watchdog timer with internal clock; SPI serial interface; BOOT area With independent encryption bit, it can be realized in system programming by the on-chip boot program, which is truly readable during write operation; full static operation; on-chip execution time is 2 clocks A periodic hardware multiplier; and five power-saving modes that can be selected by software.

The ATmega 162 is manufactured using ATMEL's high-density non-volatile memory technology. On-chip FLASH can be programmed and self-programmed via the SPI interface + through the programmer, or through the JTAG interface, or using the self-booting BOOT program. The self-booting BOOT program allows the chip to download the application through any hardware serial communication interface during the working process and write it to the application area of ​​the FLASH (IAP). When updating the application area code of the FLASH, the self-booting program in the BOOT area of ​​the FLASH will continue to execute, realizing the function of simultaneous reading and writing. By integrating the enhanced RISC 8-bit CPU with a system-programmed and application-programmed FLASH memory on a single chip, the ATmega 162 is a powerful microcontroller that provides a flexible, low-cost solution for multiple embedded control applications.

2.1 Comparison of ATmega162 and other similar devices

The most mundane CPUs in the control field are just three types: 51 series, AVR series, and PIC series. ATMEL's new 90 series MCUs include high-speed flash memory FLASH, which is based on the RISC (Reduced Instruction Set CPU) structure, which is referred to as AVR MCU. Significant improvements have been made.

Since the main CPU in this design needs to calculate and convert the temperature data, the general 51 series CPU is very difficult to perform, and the animation of the stars flashing and the reading data of the LOADING are added to the graphic display, so It is also required that the main CPU has the advantages of extremely fast operation speed and program reproducibility. Therefore, after comparison of various schemes, it was decided to use ATmega162 in the AVR series as the main CPU. At the same time, ATmega162 has two serial communication ports, which can fully satisfy the communication with the computer.

2.2 Comparison of temperature sensing devices

There are many ways to do temperature detection. It is more common to use an A/D converter and then connect a temperature sensor. Our conventional A/D sensor is 0809 (8-channel A/D converter), and the sensor can be used. According to the actual situation of the choice, the general selection principle is to meet the range of measurement temperature, accuracy and sensitivity. For this design, the temperature range to be measured is room temperature (0 to 100 ° C), the accuracy can be 1 ° C, and the sensitivity is about 1 s. So I did not use 0809 to do it, but chose an integrated chip commonly used for ambient temperature detection in the market---DS18B20, the package is TOP92, using a single bus to transmit data. From the cost point of view, the 18B20 is about 15 yuan, which is nearly half cheaper than the price of the AD0809, and it can also save the money to buy the sensor, of course, under the premise that the measurement requirements can be met.

Click to browse the product in a new window

Explosion-proof Film

The Anti-explosion Screen Protector is a Screen Protector that can effectively buffer impact, prevent the screen from bursting, or prevent the glass panel from breaking and falling apart due to accidental impact of the mobile phone. It has gloss, texture and surface hardness. The Explosion-proof Screen Protector strengthens the screen and reduces the chance of cracking, broken tempered glass is no longer frequently replaced.

Compared with other Screen Protectors, Explosion-proof Screen Protectors have the following advantages:
1. Anti-shattering: The PET material of the Explosion-proof Screen Protective Film has high strength, flexibility and elasticity, can fully decompose the impact force, and can effectively prevent the screen from being broken or damaged when the screen is impacted or dropped by external forces.

2. HD Clear: The Explosion-proof Screen Protector is made of high-quality PET material, which can maintain a high-definition screen display effect and truly display the original screen color.

3. Anti-fingerprint: The Anti-explosion Screen Protector has a built-in oleophobic and waterproof coating to prevent fingerprints and stains on the phone screen, providing your phone with original texture and perfect touch screen response speed.

The use of an Explosion-proof Anti-explosion Screen Protector can effectively enhance the durability and protection of the mobile phone screen, reduce the risk of screen cracking and damage, and at the same time protect the clarity and quality of the screen display. Ideal for protecting your screen.

PET Screen Protector, Explosion-proof Screen Protector, Explosion-proof Screen Protective Film, Explosion-proof Protective Film,Anti-explosion Screen Protector

Shenzhen Jianjiantong Technology Co., Ltd. , https://www.mct-sz.com