Selecting a microcontroller
LLP "Tornado Modular Systems",
Russia, Novosibirsk, 1995
- Selection process
- Criterias of choice
- System requirements
- Main features of the microcontroller
- Features of the microcontroller
- The instruction set of the microcontroller
- Microcontroller interrupt
- Characteristics of your company
- Characteristics of the supplier
- Characteristics of the manufacturer
- Manufacturer's support
- Literary support
- Finishing the selection
- Work team
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.
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 components and is suitable for cost and size. Clearly, a single-chip microcontroller is preferable because of 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 an optimal solution, it is possible that the entire 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 done 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, because 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, allowing to process 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 allocated enough funds to allow itself 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.
- Is the device in sufficient quantities?
- Is it produced now?
- What is expected in the future?
- Developer support.
- 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 he 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.e. product quality.
- Time work in this area.
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 from among many possible types of I / O devices should be controlled: terminals, switches, relays, keys, sensors (temperature, light, voltage, etc.), sound devices, visual indicators (LCD displays, LEDs), 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 work when your mains voltage is applied? Should the voltage be kept within a narrow fixed range of changes, or can the system operate at high instability? What is the operating current? Does the product have to operate from mains or from 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 required to satisfy their specific requirements.
MAIN FEATURES OF MICROCONTROLLER
Microcontrollers in general can be divided into groups of 8, 16 and 32-bit in size of their arithmetic and index registers, although some developers believe that the 8/16/32-bit architecture determines the bus width. Is a cheap microcontroller able to meet the requirements of the system or is it expensive 16 or 32 bit? Can 8-bit software emulation of the features of a 16/32-bit microcontroller allow 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 an 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 allowable clock frequency, while others can operate up to zero frequency. Sometimes a specific clock frequency is selected to generate another clock frequency required by 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 using which the microprocessor is made: N channel metal oxide semiconductor (NMOS), which was used in microcontrollers of early developments, is comparable to 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.
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. Built-in devices have increased reliability, 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. The range and resolution of the timer should be considered, as well as other sub-functions, such as comparison and / or capture functions of the input lines when measuring the signal duration. 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 timer for normal operation of the system watchdog, the system for detecting clock oscillator failures, the choice of 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 chip.
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 frighten 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 commands 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 energy 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 / cleared bit transition commands) that facilitate the use of the microcontroller, or commands for manipulating bit fields?
Be careful with great 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 executed? Will the system handle this situation correctly with the "exceptional" event handler or will it lead to system failure?
INTERRUPTIONS OF MICROCONTROLLER
Verifying the structure of interrupts 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) until the first instruction of the appropriate interrupt handler is executed.
CHARACTERISTICS OF YOUR COMPANY
Critically analyze the property status of your company. Does your company have sufficient funds to train personnel 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 vendor can be a microcontroller manufacturer, or it can be a dealer that is the authorized representative of several manufacturers. Well satisfy your supplier's 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 with respect to price, services and support. Always keep in mind that while 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-esteemed rewards too much.
CHARACTERISTICS OF THE MANUFACTURER
Other criteria in choosing the manufacturer / supplier of the 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. The 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? Will the factory staff be 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 necessary skills, and do they fulfill in a timely manner what they promised, for example, solve your problem or send you something? Does it 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)?
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, build 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 previously made comparative descriptions of their microcontrollers, which will simplify your task, but check on the technical descriptions, whether all the latest products are presented. Among the possible characteristics of the price (for the expected volume of products, including predicting the future price, ie will the price decrease if you join production?), RAM, ROM, EPROM, EEPROM, timer (s), A / D, D / A, serial ports, parallel ports, bus speed (minimum / maximum), special commands (multiplication, division, etc.), the number of interrupts available, the response time of the interrupt (the time from the beginning of the interrupt to the execution of the first command controlled by the interrupt) 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 microcontrollers 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 this microcontroller.
WORK OF THE TEAM
As a project leader, you can do all the research work alone, or you can start to involve your team by putting research tasks before its members, such as the programmers evaluate the instruction set of each microcontroller in question. 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 be an intermediary. After hearing all the opinions, you choose still. As in political elections, as soon as a winner in the primary elections appears, all members of the party are ready to fully support the leader, so the project team must support the leader's decisions to achieve success in the implementation of the project.
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 becomes 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.