Originally published on Maker.io (DigiKey).

Block diagram of Microchip's Configurable Logic Block

Microchip’s Configurable Logic Block (CLB), found on PIC16F131xx devices, puts a small set of programmable logic elements — AND gates, multiplexers, D and JK flip-flops — inside the microcontroller itself, wired to internal signal sources. The result is logic that runs at hardware speed without CPU involvement and without adding an external CPLD or FPGA to the BOM.

The article walks through a range of applications: Manchester encoding for custom serial protocols, an emergency shut-off FSM that reacts faster than any ISR, a 16-bit DAC built from PWM signals, and motor control safety logic (hall sensor decoding, deadband insertion, e-stop handling). For each use case the CLB replaces what would otherwise be tight interrupt code or external components, offloading the work entirely from the CPU.

For applications that outgrow the CLB’s handful of logic elements, the article surveys four larger alternatives — Cypress PSoC, TI C2000’s CLB, external FPGAs, and CPLDs — each offering significantly more capability at the cost of significantly more complexity.

Read the full article →