5.5.1 Configurable Logic Elements
The PIC16F/PIC18F Configurable Logic Cell/Block (CLC/CLB) and the PIC32CM Configurable Custom Logic (CCL) peripherals function as programmable glue logic within the device. CCL and CLC enable real-time, core-independent logic operations with custom combinatorial and sequential logic functions. Developers can add connections between internal peripherals, device pins, and events, reducing or eliminating the need for external logic components. CLB offers larger and more complex logic functions, similar to a small FPGA. Table 5-20 provides a comparison of features between PIC16F, PIC18F and PIC32CM.
| Feature | PIC16F CLC/CLB | PIC18F CLC | PIC32CM CCL |
|---|---|---|---|
| Inputs | Four inputs per module | Four inputs per module | Three inputs per Look-up Table (LUT) |
| Logic Functions Supported | AND, NAND, OR, NOR, XOR, XNOR, AND-OR,
AND-OR-INVERT, Latches LUTs (CLB) | AND, NAND, AND-OR, AND-OR-INVERT, OR-XOR, OR-XNOR, Latches | Any logic expression up to three
inputs: AND, NAND, OR, NOR, XOR, XNOR, NOT, flip-flops, latches Truth table-based |
| Sequential Logic |
Gated D flip-flop JK flip-flop D latch RS latch |
Gated D flip-flop JK flip-flop D latch RS latch |
Gated D flip-flop JK flip-flop D latch RS latch |
| Input Sources |
I/O pins, internal clocks, register bits, timers, comparators, PWM, other peripherals NVM Scanner (CLB) | I/O pins, internal clocks, register bits, timers, comparators, PWM, other peripherals |
I/Os, events Internal peripherals Subsequent LUTs |
| Output Routing | I/O pins, PWM, interrupt, other peripherals | I/O pins, interrupt, other peripherals, other CLCs | I/O pins, Event System |
| Other Features |
Output mirror registers Hardware counter (CLB) | Output mirror registers | Synchronizer, filter, edge detector |
| Interrupt Generation | Supported | Supported | Supported |
| State Machine Support | Supported (CLB) | Supported (through flip-flops, latches) | Supported (through flip-flops, latches) |
| Event System Integration | N/A | N/A | Supported |
| Low Power Operation | Supported | Supported |
Supported (sleepwalking, event-driven) |
