This article continues with a discussion of the microcontroller features and characteristics that are particularly important when you are thinking in terms of DSP capabilities.
Microcontrollers can be a convenient and cost-effective means of incorporating digital signal processing into portable devices, medical devices, audio equipment, and other products and systems. However, microcontrollers are primarily designed to control (not surprisingly) things, so if we want an MCU to be an efficient signal processor, we must choose carefully.
The previous article focused on the characteristics of the CPU, namely bit width, clock frequency, clock cycles per instruction, and floating point capability. In this article, we will look at the peripheral modules and features that make a microcontroller best suited for DSP functionality.
Some hardware modules occupy a middle position between the CPU and typical peripherals, such as timers and comparators. A common example is the hardware multiplier.
A hardware multiplier is the type of feature that could mean the difference between success and failure in a real-time DSP system. Important DSP applications such as digital filtering and spectral analysis require numerous multiplication operations, which must be done quickly enough to produce results in a reasonable time (from the user’s perspective) or, and that’s when things can be really difficult. : At a speed equal to or faster than the speed at which the data from the external system arrives.
The triangles in this FIR filter structure represent multiplication operations.
Since a large portion of microcontroller applications do not require advanced multiplier functionality, it generally makes no sense to incorporate a multiplier into the processor core. The hardware multiplier, then, is an add-on module that receives data from the CPU, performs highly efficient multiplication, and then makes the resulting data available to the CPU.
Hardware multipliers actually go beyond mere multiplication. DSP routines often require a process known as multiply and accumulate (MAC), which (as you may have guessed) involves repeatedly multiplying numbers and adding, or accumulating, the results of multiplication operations. A hardware MAC module offers even more possibilities to improve DSP performance.
The hardware multiplier built into the MAXQ615, a small and inexpensive microcontroller from Maxim, performs signed and unsigned 16-bit multiplication, multiplying and accumulating 16 bits and subtracting and multiplying 16 bits.
Direct memory access (DMA)
The first time I learned about DMA was when I was working on a software defined radio that had to quickly perform a decoding algorithm on digitized baseband signals, and that experience permanently impressed me by the value of DMA in sensitive digital signal processing. at the time.
A DMA drive is essentially a separate processor that has one job: to move data. This task is straightforward, so incorporating DMA functionality into your project does not seriously increase its complexity, and the power of the system’s DSP increases dramatically because the CPU can concentrate on processing numbers rather than mixing data between memory and data. peripherals. If your application requires a computationally intensive real-time DSP, a DMA controller can be a particularly valuable addition to your MCU’s capabilities.
The DMA controller on a SAM4S microcontroller (from Atmel) allowed me to generate this sinusoid without constantly disturbing the CPU to send the next data point to the DAC.
Digital signal processing requires not only a processor but also digital data to be processed. In most cases, this digital data will originate outside of the microcontroller, and this means that data transfer is a critical link in the DSP chain.
Parallel data transfer
I like parallel interfaces because they are simple, at least in theory, but they are less common than you might think. Transferring eight or even sixteen bits simultaneously appears to be much more efficient than sending one bit at a time, but serial interfaces are widely used even in high-speed systems. If parallel data transfer is an option on your system and you want to try it, look for a microcontroller with an “external memory interface” (EMI or EMIF), “external bus interface” (EBI), or something similar. .
Serial data transfer
yo2C is not a high speed interface, and the standard UART tends to be used for low or moderate data rates. Look for peripherals that advertise high maximum clock speeds and that use an additional signal for synchronization between the receiver and the transmitter (this allows the data signal to be fully dedicated to actual data transfer).
I think “USART” is a pretty standard abbreviation for the type of serial communication module I’m describing (the “S” stands for “synchronous”). Basically what I’m recommending here is a microcontroller equivalent to TI’s “multi-channel buffered serial port” – the abbreviation McBSP (pronounced microphone-BSP, as if the module were from Ireland, it is housed in my memory and will be perpetually associated in my mind with high speed serial data transfer …
Applications that require robust error detection can benefit from a hardware CRC module.
This is a diagram of the hardware CRC module built into a Silicon Labs EFM8 Laser Bee microcontroller. It feeds it a sequence of bytes and uses a standard CRC polynomial to generate a 16-bit result.
I truly believe that microcontrollers are preferable to digital signal processors in many low and medium intensity DSP applications, and I hope this article will help you identify microcontrollers that can reliably perform the DSP tasks that your projects require.