인피니언 8월20일부터
This page was machine-translated and may differ from the original. View original

[MCU Q&A] 3. What is the difference between MCU and DSP?

Google 우선 소스Published2016.02.01 17:06


Masaru Sugai
STMicroelectronics (www.st.com)


1. What criteria should I use when choosing an MCU?
2nd: How do I connect EEPROM to MCU?
3: What is the difference between MCU and DSP?
Part 4: MCU Peripheral Components Selection Guide Power



: Q UESTION

Both MCUs and DSPs (digital signal processors) are used for calculations. What is the difference between these two? How can I use them appropriately?

: A NSWER

A DSP is a computer designed solely for the purpose of processing a large number of complex calculations in a short period of time.

Specific applications include voice processing, image processing, signal modulation/demodulation, fast Fourier transforms, and digital filters. Some MCUs are capable of high-speed processing, but DSPs are better for complex and fast processing, as MCUs are designed primarily for general purposes.

The MCU is (16-bit data × 16-bit data) ± (16-bit data × While processing a task such as calculating 16-bit data + 64-bit data = 64-bit data requires multiple instructions, a DSP can execute this task with a single instruction in a single cycle.

This does not mean that DSPs are superior to all MCUs. MCUs are good enough for household appliances that do not require the high-speed processing capabilities that DSPs provide. MCUs are superior to DSPs in terms of versatility and usability.

However, some general-purpose MCUs, such as ARM's Cortex-M4 and M7, can support the same computations as DSPs.

Range of processing types supported by MCUs and DSPs

DSPs can process complex calculations at high speed. A DSP can perform the following calculations with a single instruction in a single cycle:

(16 bit data × 16-bit data) ± (16-bit data × 16-bit data) = 32-bit data
(16 bit data × 16-bit data) ± (16-bit data × 16-bit data) + 32-bit data = 32-bit data
(16 bit data × 16-bit data) ± (16-bit data × 16-bit data) + 64-bit data = 64-bit data

High-speed processing of these complex calculations is It is required in processing, image processing, signal modulation/demodulation, fast Fourier transform, and digital filter. In order for the MCU to perform the same processing, it must execute multiple instructions at a very high speed. Since such execution requires an MCU with extremely fast processing performance, if not impossible, using a DSP is a more convenient choice for this purpose. However, household appliances do not require high-speed processing of complex calculations, and instead require general-purpose processing functions for various types of tasks. Since there are more types of MCUs than types of DSPs on the market, users can easily find the MCU that best suits their intended product.


Figure 1 . MCU and DSP application examples (MCU application examples and DSP application examples)

To use a baseball analogy, if the MCU is an all-rounder who can play any position, the DSP is a player with exceptional specialized abilities, such as a fast runner, home run hitter, or fastball pitcher.

Figure 1 shows an application example of MCU and DSP.

Advantages of MCU

One of the best features of MCU is that it is extremely versatile and easy to use.
MCU was first born as an IC for pocket calculators, and has since continued to evolve and has been used as a control IC for home appliances and industrial equipment, and the market is growing even more. Today, MCU is used in a wide range of applications such as home appliances, industrial equipment, medical equipment, healthcare equipment, sports equipment, and gaming equipment.


Figure 2. Cortex-M4 instruction set

Simple types of MCUs are used in TV and air conditioner remote controls, built-in clocks in home appliances, and brightness control for lighting. MCUs with complex functions are used to control motors for air conditioner and refrigerator compressors. It is also used for touch detection in tablet PCs and car navigation systems.
MCUs contain many functions for various applications and can be used in a variety of products.

In addition, starter kits and free integrated development tools provided by MCU manufacturers make it easy for even novice users to start using MCUs. MCUs do not require a high level of expertise, so even middle and high school students can use them. Robot contests using MCUs and student MCU-equipped miniature car rallies are popular these days.

Advantages of DSP

DSPs perform complex calculations very quickly. The MCU needs to be able to perform calculations at extremely high speeds to perform the following calculations:

(16-bit data × 16-bit data) ± (16-bit data × 16-bit data) = 32-bit data
(16-bit data × 16-bit data) ± (16-bit data × 16-bit data) + 32-bit data = 32-bit data
(16-bit data × 16-bit data) ± (16-bit data × 16-bit data) + 64-bit data = 64-bit data
32-bit data ± (32-bit data × 32-bit data) = 32-bit data
(32-bit data × 32-bit data) + 64-bit data = 64-bit data
A DSP can perform these calculations in a single instruction in a single cycle. DSPs are extremely useful for applications that require high-speed processing of complex calculations.

In the final chapter, we'll look at some application examples to see just how fast DSP is.

MCU with DSP function

Some recent types of MCUs, including ARM's Cortex-M4 and Cortex-M7, have built-in high-speed computational capabilities that were once a DSP's function. The "M" in the Cortex-M series stands for microcontroller. This series was first introduced to the market as an MCU, and later the Cortex-M4 series began supporting DSP instruction sets, making it possible for it to be used as a DSP as well.

Figure 3. Example of application of DSP commands (coding for sensorless motor)

The Cortex-M4 and Cortex-M7 can be used as either an MCU or a DSP, as the DSP instruction set is a new addition to the existing Cortex-M3 MCU instruction set. Figure 2 shows the Cortex-M4 instruction set. The DSP instruction set is added to include the Cortex-M3 MCU instruction set. Note that Cortex-M4 supports floating point arithmetic instructions (IEEE 754 compliant).

Let's look at the speed difference between Cortex-M3 and Cortex-M4 using DSP instructions using an example of coding for a sensorless motor. The left side of the table in Figure 3 is a portion of the coding using the Cortex-M3 instruction set. The right side is a portion of the coding using the Cortex-M4 DSP instructions that replace the left side.

The instructions in lines 1 and 2 can be replaced by a single DSP instruction, and similarly the instructions in lines 4 and 6. Since each DSP instruction is executed in a single cycle, each saves 3 cycles.

Comparing MCU and DSP

Figure 4. Comparison of MCU and DSP

Figure 4 compares the MP3 audio reproduction performance between MCU, general DSP, Cortex-M4, and audio DSP. The horizontal axis represents the operating frequency required for MP3 decoding. The lower the frequency value, the higher the performance. Naturally, the audio-only DSP shows the best performance, followed by Cortex-M4 (estimated value) and a regular discrete DSP. The general purpose MCU shows the lowest performance, which is understandable since audio reproduction is not the target application of this MCU.

Even a typical discrete DSP is showing performance that is twice as fast as a general-purpose MCU. This shows how suitable DSP is for performing complex calculations quickly.
본 기사에 대한 정정·반론·추후보도 청구는 보도 청구 안내를, 그간 게재된 보도문은 정정·반론보도 모아보기를 참고해 주세요.
신윤오 기자