This page has been robot translated, sorry for typos if any. Original content here.

Selecting a microcontroller

Transfer
LLP "Tornado Modular Systems",
Russia, Novosibirsk, 1995

INTRODUCTION

Perhaps, it is the choice of a microcontroller that is one of the most important decisions on which the success or failure of a conceived project depends. When choosing a microcontroller, it is necessary to take into account and evaluate a large number of factors. As a basis for a sequence of thoughtful actions leading to a final decision, the plan discussed in this article can be adopted. By combining their own knowledge and requirements with the information presented in this article, the reader must evaluate everything in general in order to make the right decision.

APPOINTMENT

The main goal is to choose the least expensive microcontroller (to reduce the total cost of the system), but at the same time satisfying the system specification, i.e. Requirements for performance, reliability, application conditions, etc. The total cost of the system includes everything: engineering research and development, production (components and labor), warranty repair, further improvement, maintenance, compatibility, ease of handling, etc.

THE PROCESS OF CHOICE

When choosing a developer, the developer must first ask himself: "What should the microcontroller in my system do?" The answer to this simple question determines the characteristics of the microcontroller required for the system being developed and, thus, is the determining factor in the selection process.
The second step is to search for microcontrollers that meet all system requirements. It usually includes the selection of literature, technical descriptions and technical journals, as well as advice. At present, information on both the traditional industry standard microcontrollers and the latest microcontrollers has become quite accessible. Well, if the system requirements are met by a well-known microcontroller, otherwise a secondary search must be performed to find the microcontroller that best meets the requirements, has a minimum of external attachments and is suitable for cost and size. Clearly, a single-chip microcontroller is preferable because of its price and reliability.
The final stage of the selection consists of several stages, the purpose of which is to narrow down the list of acceptable microcontrollers to one. These stages include the analysis of price, availability, development tools, support for the manufacturer, the stability of the production of specific microcontrollers and the availability of other manufacturers or suppliers. To arrive at the optimal solution, it is possible that the whole process will have to be repeated several times.

CRITERIAS OF CHOICE

The main criteria for choosing a microcontroller are presented below in order of importance. Each criterion is explained in detail later.

  • Suitability for the application system. Can it be made on a single-chip microcontroller or can it be implemented on the basis of a specific chip?
    • Does the microcontroller have the required number of contacts / I / O ports? If they are not enough, they will not be able to do the work, and in case of excess, the price will be too high?
    • Does it have all the required peripherals, such as serial I / O ports, RAM, ROM, A / D, D / A, etc.?
    • Does it have other peripherals that are not needed in the system?
    • Does the core of the processor provide the required performance, i.e. Computing power that allows processing system queries throughout the life of the system in the selected application language? Too much is wasteful, too little will not work.
    • Is the project budget allocated enough funds to afford to use this microcontroller. To answer this question, supplier prices are usually required. If this microcontroller is not acceptable for the project, all other issues become irrelevant, and you should start searching for another microcontroller.
  • Availability.
    • Is the device in sufficient quantities?
    • Is it produced now?
    • What is expected in the future?
  • Developer support.
    • Assemblers.
    • Compilers.
    • Debugging tools.
      • Evaluation module (EVM).
      • In-circuit emulators.
      • Nozzles for logic analyzers.
      • Debug monitors.
      • Debuggers programs in the source code.
  • Information support
    • Examples of application.
    • Error messages.
    • Utilities, including "free" assemblers.
    • Examples of source code.
  • Support of applications from the supplier.
    • Is there a special group that only supports applications?
    • Are there engineers, technicians or sellers?
    • How qualified is the support staff, is it really interested in helping you solve your problem?
    • Is there a telephone and / or FAX connection?
  • Reliability of the manufacturer.
    • Competence, confirmed by developments.
    • Reliability of production, i.е. Product quality.
    • Time work in this area.

SYSTEM REQUIREMENTS

Carrying out a system analysis of your project will also determine the requirements for the microcontroller. What peripherals are required? Are bit operations used or only numeric? How much manipulation is required to process the data? Should the system be controlled by interrupts, by readiness or by human commands? How many devices (I / O bits) need to be managed? Which devices among the many possible types of I / O devices should be controlled: terminals, switches, relays, keys, sensors (temperature, light, voltage, etc.), sound devices, visual indicators (LCD, LED), analogue ( A / D), digital-to-analog (D / A) converters? Is one or more supply voltages required for the system? Is the power supply fault-tolerant? Will the device operate when your mains voltage is applied? Should the voltage be kept in a narrow fixed range of changes, or can the system operate at high instability? What is the operating current? Does the product work from mains or batteries? If on batteries, should rechargeable batteries be used and if so, what is the operating time without recharging, and what time is it required for it? Are there any restrictions on size, weight, aesthetic parameters, such as shape and / or color? Are there any specific requirements for environmental conditions, such as military conditions, temperature, humidity, atmosphere (explosive, corrosive, etc.), pressure / height? User software should be based on disks or ROMs? The product works in real time, and if so, are you going to create or acquire a real-time program kernel or, perhaps, a fairly common widely used version? Is there enough staff and time to develop your own program kernel? How will copyrights and software be paid? To solve real-time problems, a lot of research is needed to satisfy their specific requirements.

MAIN FEATURES OF MICROCONTROLLER

Microcontrollers in general can be divided into groups of 8, 16 and 32-bit by the size of their arithmetic and index registers, although some developers believe that the 8/16/32-bit architecture determines the bit width. Can a cheap microcontroller meet the requirements of the system or is it expensive 16 or 32 bit? Can 8-bit software emulation of a 16/32-bit microcontroller's features permit the use of a cheap 8 bit, sacrificing the size of executable code and speed? For example, can a 8-bit microcontroller be used with a software macro to emulate a 16-bit battery and indexing operations? The choice of the application language (high level instead of assembler) can greatly affect system performance, which can then dictate the choice of 8/16/32-bit architecture, but the price cap may reject this choice.
The clock frequency or, more accurately, the bus speed determines how many calculations can be performed per unit of time. Some microcontrollers, mostly early ones, have a narrow range of permissible clock frequency, while others can operate up to zero frequency. Sometimes a specific clock frequency is selected to generate another clock frequency required in the system, for example, to set the serial transmission rates. Basically, the computing power, power consumption and cost of the system increase with increasing clock speed. The price of the system increases with the increase in frequency due to the cost not only of the microcontroller, but also all the required additional microcircuits, such as RAM, ROM, PLD and bus controllers.
Consider the technology used to manufacture the microprocessor: the N-channel metal oxide semiconductor (NMOS), which was used in early-development microcontrollers, is comparable to the modern CMOS technology with a high level of integration (HCMOS). Unlike early NMOS processors, in HCMOS signal levels vary from 0 to the voltage level. In this regard, preference is given to HCMOS processors. In addition, HCMOS consume less power and, therefore, less heat. The geometric dimensions of the elements in the HCMOS are smaller, which makes it possible to have more dense circuits and, thus, operate at higher speeds. A denser design also reduces the cost of an individual microcontroller, because A larger number of chips can be obtained on a silicon wafer of the same size. For these reasons, today the vast majority of microcontrollers are manufactured using HCMOS technology.

MICROCONTROLLER OPPORTUNITIES

By achieving a higher level of integration and reliability while maintaining a low price, all microcontrollers are equipped with built-in additional devices. These devices under the control of the microprocessor core of the microcontroller perform certain functions. Embedded devices are more reliable, because they do not require any external electrical circuits. The most well-known embedded devices include memory devices and I / O ports, timers, a system clock / generator. Memory devices include random access memory (RAM), read-only memory (ROM), reprogrammable ROM (EPROM), electrically-reprogrammable ROM (EEPROM). Timers include both real-time clock and interrupt timers. You should take into account the range and resolution of the timer, as well as other subfunctions, such as comparison and / or capture functions of input lines when measuring the duration of a signal. I / O means include serial communication ports, parallel ports (I / O lines), analog-to-digital converters (A / D), digital-to-analog converters (D / A), LCD drivers or VFDs.
Other, less commonly used, embedded resources are the internal / external bus, the watchdog for monitoring the normal operation of the system, the watchdog, the system for detecting clock oscillations, the choice of the memory configuration and the system integration module (SIM). SIM normally replaces the external "gluing" logic necessary to organize the interaction of the microcontroller with external devices through the specified contacts of the microcircuit.
Most microcontrollers with in-circuit resources include a block of configuration registers for managing these resources. Sometimes this block itself can be reflected in different places of the memory card. Sometimes there is a user and / or factory test register, indicating what value the manufacturer attaches to quality. The presence of configuration registers leads to the problem of accidentally changing the desired configuration by a "wandering" code. To prevent such an accidental opportunity, a "blocking" mechanism is used, i.e. Before the configuration register can be changed, the bits in the other register must be changed in a certain sequence. Although the configuration registers can initially startle with their complexity, they are extremely valuable because they provide high configuration flexibility at low cost, so that a single microcontroller can find a wide variety of applications.

SET OF MICROCONTROLLER COMMANDS

It is necessary to carefully study the set of instructions and registers of each microcontroller, since they play a crucial role in determining the capabilities of the system as a whole. Have your programmers studied index addressing modes in connection with the perceived needs of your system? Are there any special commands that will be used on your system, such as multiplication, division and table interpolation? Are there any power saving modes to save battery power, such as stop, stop, low power consumption and / or with waiting? Are there any bit manipulation commands (bit setting, bit clearing, bit test, bit change, set / clean bit transition commands) that facilitate the use of the microcontroller, or commands for manipulating bit fields?
Be careful with the wonderful teams that perform many actions in the same team. The real performance criterion is the number of clock cycles required to perform a task, rather than the number of executed commands. For a fair comparison, it's better to encode the same program and compare the total number of clock cycles and bytes used. Are there any unrealized instructions in the operational code card and what will happen if they are accidentally performed? Will the system handle this situation correctly with a handler of "exceptional" events or will it lead to system failure?

INTERRUPTIONS OF MICROCONTROLLER

Verification of the interrupt structure is always necessary when a real-time system is created. How many lines or levels of interruption are there and how many are required for your system? Is there an interrupt level mask? When the interrupt level is confirmed, are there individual vectors for the interrupt program program, or should all interrupt sources be interrogated to determine the source? In critical applications such as printer management, the criterion for selecting the appropriate microcontroller may be the interrupt response time, i. E. Time from the beginning of the interrupt (in the worst case, phased relative to the clock of the microcontroller) before the execution of the first command of the appropriate interrupt handler.

CHARACTERISTICS OF YOUR COMPANY

Critically analyze the property status of your company. Does your company have sufficient funds to train staff in the finer points of the production of microcontroller-based systems and the use of development tools? Does your company already have sufficient development tools, or will you buy or rent them? If a new microcontroller is being considered, are there any development tools available such as high-level language compilers, assemblers / linkers, prototype modules, and debuggers / emulators? Is your development tools for new microcontrollers easy to expand? Do I need to hire and train additional staff for this project? Can you attract an expert to train the rest of your team? Does the budget allow you to hire additional permanent staff and / or contract workers? Is your company satisfied with the microcontrollers currently available on the market, as well as maintenance?

CHARACTERISTICS OF THE SUPPLIER

The third step in reducing the list of technically acceptable microcontrollers is checking the manufacturers and suppliers of microcontrollers, i.e. Companies with whom you plan to enter into a long-term relationship on a mutually beneficial basis. The supplier can be a microcontroller manufacturer, or it can be a dealer that is the authorized representative of several manufacturers. Well satisfy your supplier requests with a wider assortment of products and the reputation of high quality, reliability, service and timely delivery at a fair price. In addition, the more products you buy from a single vendor, the greater benefits you get in terms of price, service and support. Always keep in mind that although the dollar volume of your purchase may seem high to you, it is always relative to the total sales of the supplier. Vendors that supply not only microcontrollers but also memory (RAM, ROM), discrete devices (transistors, diodes, etc.), standard digital logic devices (7400, 74HC00, etc.), special chips, custom devices (CSIC), specialized microcircuits (ASICs) and programmable logic devices (PLDs), can better meet your growing demands. Does the manufacturer and / or supplier have any rewards for quality, reliability, service and / or delivery? You should not trust self-sacrificing rewards too much.

CHARACTERISTICS OF THE MANUFACTURER

Other criteria in choosing a manufacturer / supplier of a microcontroller are stability, its monopoly position, information from the literature and support. Stability can be reliably verified by establishing the work experience of the manufacturer in this field and its achievements. The supply department and the credit department of your company can help you in these matters. Monopoly position of the supplier, unfortunately, is usually the norm, because Most microcontroller manufacturers rarely intersect in production with other manufacturers. If the manufacturer has good indicators in supply, delivery and price, then its monopoly position should not be an obstacle.

SUPPORTING THE MANUFACTURER

Direct support of the manufacturer includes marketing / sales and applied engineering support. When you call, asking for help, can you directly contact someone who you need, or do you have to play a "deaf phone"? Are calls transmitted immediately? Is there a fax number? How many telephone lines are available? Phone lines are always busy? Do they have a switching system or a secretary that passes your messages to the person responsible for the support? What hours does the support staff work? Do they have other responsibilities besides support? What is the number of staff? Is the factory staff ready to help him, namely, specialists in finished products, in production, in quality, electronic engineers, programmers? Are the factory engineers friends with the support staff? Does the support staff know if they have the right skills, and do they fulfill in a timely manner what they promised, for example, to solve your problem or to send you something? Does this come by regular mail, do you pay for fast delivery? Does the manufacturer have an electronic bulletin board (BBS) or a page on the Internet, where you can get information such as application programs, product news, fresh programs, source code, error messages, e-mail, conferences? What are the transmission rates supported? How many telephone lines are available? What are the opening hours? Do you need a special brand of computer and / or modem for access? Is there a system operator (sysop)?

LITERARY SUPPORT

The literature covers a wide range of printed materials that can help you make the right choice. It includes the manufacturer's releases, such as technical descriptions and recommendations for use, as well as publications available at the local bookstore and / or library. Editions from a local store and / or library not only indicate the popularity of the manufacturer / microcontroller, but also offer impartial opinions if they are expressed by producers independent of the manufacturer.

FINISHING THE CHOICE

For the final step in the selection process, construct a table containing the microcontrollers in question in one column, and their important characteristics in the other. Then attach the forms of the manufacturer's specifications to get a fair visual comparison. Some manufacturers have pre-made comparative descriptions of their microcontrollers that will simplify your task, but check by technical descriptions if all the latest products are presented. Among the possible characteristics of the price (for the expected volume of production, including the prediction of future price, ie whether the price, if you will join decrease in production?), RAM, ROM, EPROM, EEPROM, the timer (s), A / D, D / A, serial ports, parallel ports, speed bus (minimum / maximum), special commands (multiplication, division, etc.), the number of available interrupts, interrupt response time (time from start to interruption of the first command, interrupt-driven) Body size / type (ceramic DIP or LCC, plastic 0.3 "DIP or 0.6" DIP, compressed DIP (distance yanie contacts between .071 "), PLCC, PQFP, EIAJQFP, SOIC; some of them use surface mount technology), power requirements, and other details that are important for your system devices.

If, after all this, you still have more than one microcontroller in the list, consider the possibilities of system expansion and cost. What extensions do you think may be needed in future versions of this product? Finally, consider the price, because if two of the microcontroller are the same, but one offers a bit more features that are not required today, but would make future extensions available without additional costs, choose the microcontroller.

WORK OF THE TEAM

As project leader, you can do all the research work one, or you can start attracting your team, setting its members research tasks, such as assessment of programmers instruction set of each considered microcontroller. Involving your team in the selection process in the early stages, you will not only create the spirit of the team, but also get individual commitments to the project through active participation in it. This approach, no doubt, leads to some conflicts, because Everyone has their own opinion, but your task as a project leader is to mediate. After hearing all the opinions, you choose still. As in political elections as soon as the winner of the primary election, all party members are ready to fully support the leader and project team leader should support the decision to succeed in carrying out the project.

CONCLUSION

The final choice of a suitable microcontroller for your project is not an easy decision. Microcontrollers have become more sophisticated devices since the in-circuit resources were added. And since the process moves towards more and more in-circuit integration of external resources to lower the cost of the system, the solution is becoming more complex. This article does not impose any choice on the developer, its purpose is to indicate all possible selection criteria that must be taken into account in the decision-making process.