(Source: Archara / stock.adobe.com; generated with AI)
There are always compromises to be made when designing any electronic system, but today’s designs challenge engineers more than ever with demands for higher performance, additional features, smaller form factors, less power usage, lower costs, or any combination of these targets.
One way to tackle these challenges is through configurable logic. Configurable logic is like having a tiny field programmable gate array (FPGA) inside your microcontroller (MCU), and instead of relying only on software or external hardware to handle logic functions, designers can incorporate custom, hardware-based functions right inside the microcontroller. This way, designers don't have to rely as heavily on external components while also speeding up processing and optimizing power efficiency. In this blog, we will explore some of the advantages provided by configurable logic in MCUs and examine a comprehensive solution from Microchip Technology.
Minimizing MCU power consumption is essential as it significantly impacts overall system power consumption. The MCU is the brain of the system, and choosing the correct one is crucial for meeting design constraints. It should provide the required performance and have some headroom for upgrades. Additionally, integrated peripherals for popular functions simplify the design process, reduce component count, and save board space.
Microchip Technology has innovated the MCU by incorporating main system peripherals into the package, allowing them to function independently of the central processing unit (CPU). These core independent peripherals (CIPs) handle specific tasks without CPU oversight, enabling the CPU to stay in sleep mode or focus on other tasks. Each CIP is designed for a specific function, such as monitoring safety or conditioning waveforms, and can be customized for the application.
CIPs offer advantages over CPU-based implementations, including faster response times and reduced CPU time and memory contention. Furthermore, they allow designers to optimize the design for power or memory usage.
Even though CIPs offer predefined functionality for common tasks, some applications need more flexibility. This is where configurable logic blocks (CLBs) come in. Unlike CIPs, which are designed for specific functions, CLBs offer fully customizable logic that engineers can configure to meet their needs.
Microchip Technology has taken the CIP philosophy further and introduced the CLB in the PIC16F13145 microcontroller family. The CLB operates independently of the core, in the same way as a CIP, but has no defined function. Its reprogrammable logic design can be customized to meet many applications. The CLB brings all the benefits of CIPs, such as power saving, increased performance, and highly integrated designs, with the designer able to implement completely bespoke applications.
The CLB circuit has 32 basic logic elements (BLEs) arranged in four blocks. Each BLE can be configured to simulate an AND/OR/NAND/NOR gate, buffer/inverting buffer, D flip-flop, J-K flip-flop, or multiplexers (Figure 1).
Figure 1: CLB architecture is equipped with BLEs, input/output connectivity, and hardware features like edge detection and state machine timers for enhanced embedded system flexibility. (Source: Microchip Technology)
The CLB also supports dynamic configuration for on-the-fly changes and tri-state logic. Each BLE can connect internally to other BLE blocks, registers, and counters, as well as to external peripherals, I/Os, oscillators, and even other CIPs. Moreover, each BLE has a 4-input lookup table (LUT), combination logic, and a flip-flop. The graphical user interface (GUI)-based CLB graphical synthesizer in Microchip Technology’s MPLAB® Code Configurator (MCC) can customize the BLE blocks, allowing designs to be built and synthesized without the need for coding.
Glue logic is an ideal demonstration of CLB technology’s advantages. Today, discrete components or programmable logic are used for glue functions, such as linking different circuit areas together with logic gates or level-shifting voltages. CLB technology can perform the same tasks quickly and easily without adding more components to the design. The programmability of the CLB also enables glue logic to be reconfigured as needs arise.
Another ideal area for CLB technology is encoding and decoding. This is a repetitive task well suited to programmable logic. For example, power over data line (PoDL) communications is becoming popular due to its simple construction, with only a single wire pair required for both power and data. Manchester coding is used in PoDL to ensure data integrity by synchronizing the data between ends and performing error detection (Figure 2). Discrete encoders require large passives, increasing both the solution’s size and cost. CLB technology can speed up the encoding process and allow faster data rates.
Figure 2: The CLB-based Manchester encoder can easily be customized to a specific bit rate. (Source: Microchip Technology)
CLB technology can provide advantages over traditional technology in fault detection. Many circuits require fault detection to check for common faults in real time, and when one is found, to place the circuit in a safe state. These checks usually have to be done very quickly without affecting the operating performance of the circuit, meaning that hardware is the preferable solution with its faster responses and more predictable timing. Using MCU-based software for error detection is difficult because error conditions don’t have known timings and software edge cases could throw errors that delay the safe state. A discrete programmable logic device is often used for this role, but this is expensive and needs additional design time for integration. CLB technology can achieve the same or better performance using a single chip.
Timing control and power sequencing are also important in complex embedded systems. Power-sensitive designs often require a precise order of power-up and power-down events to ensure stability and prevent component damage. Typically, this requires external power sequencing ICs or software-controlled sequencing. This can complicate and delay processes. With CLBs, power sequencing logic can be incorporated directly into the hardware so that designers can ensure the power rails are activated and deactivated in the correct sequence with less delay.
Finally, CLB technology can be used to replicate parts of a system for redundancy purposes, removing single points of failure. For example, a simple function performed in the MCU could have a CLB-based backup, and this logic-based backup could still function if a software error occurred in the MCU function.
Embedded systems today are more complex and power-efficient, and designers need microcontrollers that bring more to the table than just processing power. They needed flexibility. Microchip Technology's CLBs bring FPGA-like configurability to microcontrollers, reducing external components, enhancing performance, and optimizing power efficiency.
Since graduating with a BSc in Electronic Systems from the University of the West of Scotland in 1997, Alistair Winning has worked in electronics media across marketing, PR, and journalism roles. During that time, he worked as the editor of Electronics Engineering, Embedded Systems Europe, EENews Embedded, Technology First, Electronic Product Design and Test, and Panel Building and Systems Integration magazines. Currently, Allistair is the European Editor of Power Systems Design and a freelance writer, specializing in electronics and engineering.
Microchip Technology Inc. is a leading provider of microcontroller, mixed-signal, analog and Flash-IP solutions, providing low-risk product development, lower total system cost and faster time to market for thousands of diverse customer applications worldwide. Headquartered in Chandler, Arizona, Microchip offers outstanding technical support along with dependable delivery and quality.