Page 397 - Introduction to Microcontrollers Architecture, Programming, and Interfacing of The Motorola 68HC12
P. 397

374                                        Chapter 12 Other Microcontrollers


        run, and DOZE causes the processor to enter low-power doze mode in which some
        peripherals continue to ran. STOP causes the processor to enter low-power stop mode.
        The MMC2001, a first implementation of the M-CORE family, uses 40 milliamps at
        3.3 volts. Both wait and doze modes have current drain of 3 milliamps, and the stop
        mode has current drain of only 60 microamps. SYNC causes the processor to suspend,
        fetching new instructions until all previously fetched instructions complete execution.
            To conclude this section, in Figure 12.14, we illustrate the overused inner product
        subroutine again, passing the parameters in registers by value. Upon input, GPR rl has
        v[0], r2 has v[l], r3 has w[0], and r4 has w[l], and upon exit, rl contains the result,



         12.7 Selecting a Microcontroller for an Application

        Suppose you are designing a product that will have a microprocessor in it. Which one
        should you use? You have to look at many different alternatives, such as the ones we
        looked at in this chapter and similar microcomputers made by other companies. You
        should not select one with which you are very familiar, such as the 6812, or one that
        you are overwhelmed with, such as the 500 series, unless you have good reason to select
        it. You have to analyze the needs of the application to pick the most suitable
        microcomputer. Smaller computers are less costly, and larger computers make it easier to
        write large programs. However, many of the techniques are the same as those you have
        already learned, passing parameters, handling local variables, writing clear programs, and
        testing them. You are prepared to learn to read the 68300 series, 500 series, or M-CORE
        family programs. However, the greater size and complexity of these microcomputers
        requires longer to master all of their peculiarities than smaller microcomputers, to enable
        you to fluently read their programs.
            Generally, the larger the microprocessor, the easier it is to write large programs, The
        68300 series, 500 series, and M-CORE family have more capabilities to handle high-
        level languages, such as C or C++, and have an instruction set that allows assembly-
        language programs to be written that can handle fairly complex operations in short
        fashion (such as the LINK instruction). It is easy to say that the larger the
        microprocessor, the better, and to select the largest one you can get. But consider some
        other aspects.
            The smaller microcomputers such as the 6805 are very inexpensive. A version of
        this 6805 sells for only 50 cents. You can build a fully functioning microcomputer
        using just the 6805 and a couple of resistors and capacitors. The 68300 series requires
        external SRAM and ROM to make a working computer. The cost of the integrated
        circuits, the printed circuit board, and the testing needed to get the board working make
        the 68300 series system more than an order of magnitude more expensive than the 6805
        system. An M-CORE microcontroller, running with a 32 MHz clock, can require more
        than a two-layer printed circuit board. Multilayer boards are significantly more expensive
        than one- or two-layer boards. This can make a big difference to the cost of your product,
        especially if you intend to make thousands of copies of the product.
            The trend toward networking should be observed. If you divide your problem in half,
        each half may fit on a smaller microcomputer. We once read a news article that claimed
        the Boeing 767 jet had over a 1000 microcomputers scattered throughout the wing tip,
   392   393   394   395   396   397   398   399   400   401   402