Special IC decryption technology--AVR application skills

Publisher:BlissfulJourneyLatest update time:2012-10-15 Source: 21ic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Compared with traditional types of single-chip microcomputers, AVR has made great improvements in structural system, functional components, performance and reliability in addition to realizing some basic functions in IC chip decryption technology.

However, using better devices only creates a good foundation and possibility for designing and implementing a good system. If you still use and follow the traditional hardware and software design ideas and methods, you cannot make good use of AVR, and you cannot even truly understand the characteristics and strengths of AVR.

The better the function of the device, the more people with higher skills and abilities are needed to use and drive it. IC chip decryption is like a good F1 racing car. Only a driver with superb skills can fully appreciate the characteristics of the car and maximize its performance.

AVR has the characteristics of quick learning and simple development. However, to fully appreciate and utilize the advantages of AVR, application engineers are also required to continuously learn and practice hardware and software design and development capabilities and IC chip decryption.

"The layman sees the excitement, the expert sees the doorway", for engineers who have a certain foundation in embedded and single-chip system design and development, it may be a good idea to give AVR a simple try first.

Development environment and tools: PC + download cable + actual system board

Development software on PC:

AVR Studio (Free) assembly + assembly debugging + high-level language debugging + software simulation

ICC, CVAVR, BASCOM-AVR high-level language program development + program download. One of them is purchased as a genuine full-featured version as the main development environment, and the other uses the DEMO version as an auxiliary and reference.

AVR ISP download cable:

STK200 and STK200+ and STK300 ISP programmer. Through the printer port of PC, use ISP technology to write system running code (HEX, BIN) and data into Flash and EEPROM of AVR chip, and program the configuration fuse and encryption bit of AVR. Support most AVR chips, as well as ATMEL's 51 compatible chips 89S8252, 89S52, etc. In ICC, CVAVR, BASCOM-AVR, BASCOM-8051, there are built-in support programs for this download line. Free dedicated download programs: SLISP, PonyProg2000, etc.

Tips for not using the emulator as much as possible:

When developing and debugging system programs and IC chip decryption, many people completely rely on IC chip decryption, and feel at a loss once they leave the emulator. In fact, since the AVR's Flash memory can be easily erased and written online multiple times using ISP technology, it is recommended not to use (rely on) the emulator to develop and debug programs.

In the actual development process, program debugging can start from the following aspects:

Today's high-level language compilers (such as C compilers) can generate very efficient machine codes, so it is recommended that you use high-level languages ​​to write system programs as much as possible.

Use the AVR Studio software simulation environment provided by Atmel, as well as other software simulation environments (BASCOM-AVR).

Whenever possible, use high-level languages ​​to write system programs.

Use the LED, LCD or asynchronous serial port on the target board. See the attached "How to develop AVR without an emulator" for an introduction.

Improve the rationality of hardware design:

Try to use the resources within the AVR chip as reasonably and fully as possible, such as EEPROM, A/D, and internal RC oscillator source.

Try to use peripheral devices connected by serial communication, large-capacity memory, LCD controller, printer, use 7279 instead of 8279 (LED digital tube + keyboard), etc. Except for the need to expand RAM (such as voice and image), it is generally not recommended to use parallel expansion (573 + decoding circuit), which reduces the probability of hardware, wiring and PCB board errors, and also improves the reliability of the system. Parallel expansion to serial expansion is a development trend. Now there are a large number of new peripheral devices using high-speed serial interfaces, such as A/D, D/A, RTC, memory, etc.

Try to use and reserve the ISP program download interface on the target board, or use IAP technology.

Advantages: The compatibility of ISP interface and I/O is better than JETAG.

Disadvantage: Cannot debug online

Pay attention to and master the use of AVR configuration fuse bits:

Try to use high-level languages ​​to design and write system programs. Many people think that using assembly language to write programs is more concise, and using high-level languages ​​to develop will waste a lot of program space. In fact, this is a misunderstanding. For an experienced assembly expert who is very familiar with a certain microcontroller, he can write more concise code than high-level languages. For developers who are not very familiar with assembly language, or suddenly change to a new microcontroller, can you guarantee that you can write more concise code than high-level languages?

Today's high-level language compilers (such as C compilers) can generate machine codes with very high code efficiency. Therefore, it is recommended that you write programs that can be implemented in high-level languages ​​in high-level languages ​​as much as possible. In situations where speed and timing requirements are particularly strict, a hybrid programming method can be used to solve the problem.

A more in-depth and comprehensive understanding of the various serial communication protocols:

Embedded systems currently use a large number of serial interface peripheral chips and various communication interfaces, such as RS232, two-wire (I2C), three-wire (SPI), single bus, USB, CAN, TCP/IP, etc. Developers and programmers should understand low-level protocols, be familiar with how hardware implements low-level protocols, how to define reliable upper-level application protocols, and the interface design between low-level protocol drivers and upper-level application protocols (implementation of middle-level software).

Hardware engineers need to improve their software writing skills, adopt standard programming methods, perfect software overall framework design, and good data structure and program structure systems. (Programmers majoring in computer software are not familiar with hardware, and most of them write software under the support of operating systems. They also do not understand the driver layer and interface of low-level interfaces and protocols, and often cannot write good single-chip system programs.)

The communication interface should be written as

.Use interrupt + buffer,

.Layered + structured design,

.Try not to use the round-robin method (reduces the efficiency of the AVR). See the URAT (RS232) driver + middleware software example.

Adopt good system design patterns:

Try not to use the traditional foreground and background (interrupt) system design mode, where tasks affect and interfere with each other and cannot be operated on a regular basis. For example, design an 8-bit LED digital tube display driven by dynamic scanning + a 4*4 matrix keyboard with dynamic scanning.

Adopt TimeTip+state machine design+CASE structure to realize multi-task parallel operation system design method. Or time-triggered system design. (See: "Time-triggered Embedded System Design Pattern" China Electric Power Press 2004.6)

Porting a small embedded operating system, such as UCOS-II. There are some free simple AVR-based operating systems on the Internet.

Improve C language programming skills and software application level:

Be familiar with and make good use of more advanced applications in C, such as data structures, pointer applications, memory management, etc.

Be familiar with and understand the characteristics of the high-level language development platform you are using. These platforms are targeted at a certain type of processor and contain many special incompatible statements and extended structures, statements, functions, etc. Although they are easy to use, they should be used reasonably due to their opacity and time uncertainty. For example, getchar(), putchar() in C, etc.

AVR has multiple development platforms, each with its own characteristics and shortcomings. The ability to use these platforms in combination and complement each other can improve development efficiency. For example, through the ICC and CVAVR program generator CodeWizard, you can learn and understand the hardware settings of AVR, simplify calculations, and quickly generate basic program modules, such as "a URAT (RS232) low-level driver + middle-level software example".

Reference address:Special IC decryption technology--AVR application skills

Previous article:Design of elevator call display board based on AVR microcontroller CAN bus
Next article:Design of digital electronic scale based on ATmega16 single chip microcomputer

Recommended ReadingLatest update time:2024-11-16 19:43

AVR digital display frequency meter and tachometer
This is a very small electronic product, but it is very powerful. It can be easily embedded and installed on the instrument panel. It is suitable for enthusiasts to make or modify old instruments.   The circuit uses only two integrated circuits. CD4069 is used for amplification and shaping of small signals, and AT90S2
[Microcontroller]
AVR digital display frequency meter and tachometer
AVR external interrupt experimental program
Introduction: Use a button to control the 1-digit LED digital tube display, just a simple test of the response to external interrupts. The program does not add button debounce processing, and it really shakes violently. /***************************************************** This program was produced by the CodeWizar
[Microcontroller]
About AVR interrupt priority
In the same priority level of AVR microcontroller, the lower the interrupt vector entry address, the higher its priority level. After responding to an interrupt, the AVR microcontroller will prohibit the system from responding to other interrupts. If the program needs to respond to other interrupt events in an interru
[Microcontroller]
Compile, burn and debug methods of avr series under Linux
The environment of this article is as follows: OS system: Ubuntu 12.04 (originally 10.04, recently upgraded) Compiler: avr-gcc Burning software: avrdude Debugging software: avarice, GDB and ddd (visual interface) Development Board: 1.xplain (xmega128a1) cannot be debugged and can only be burned because the
[Microcontroller]
Defining data and command input methods in AVR
//CS=0 A0=0 write data port  #define LcmWdataPort (*(volatile unsigned char *)0xFC00)   //CS=0 A0=1 write command port      #define LcmCmdPort (*(volatile unsigned char *)0xFE00)   volatile unsigned char * means to convert the following data into pointer type
[Microcontroller]
Research on AVR microcontroller used in power management system
Introduction: This paper designs a UAV power management system, which has the functions of automatic control of charge and discharge management, real-time monitoring of battery voltage, etc. The system has been debugged and tested to verify its feasibility, but in order to ensure the safety of the aircraft, more tests
[Microcontroller]
Research on AVR microcontroller used in power management system
AVR microcontroller control AC motor test program
MCU: at90s2313  Clock: 4MHz #include  avr/io.h   #include  avr/delay.h   #define uchar unsigned char  #define uint unsigned int #define SET_RED_LED PORTD|=_BV(5) //PD5接红色发光管  #define CLR_RED_LED PORTD&=~_BV(5)  #define SET_GRN_LED PORTD|=_BV(4) //PD4接绿色发光管  #define CLR_GRN_LED PORTD&=~_BV(4)  class  CC ontrol  {  publ
[Microcontroller]
Medium frequency power supply test system based on AVR microcontroller
1 Introduction The measurement and monitoring of electrical parameters is an important part of the power system. Starting from the engineering practice of the test system, this paper completes the measurement and real-time monitoring of the voltage , current , frequency, power
[Power Management]
Medium frequency power supply test system based on AVR microcontroller
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号