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.

Table 5-20. PIC16F, PIC18F and PIC32CM CCL Features
FeaturePIC16F CLC/CLB PIC18F CLCPIC32CM CCL
InputsFour inputs per moduleFour inputs per moduleThree inputs per Look-up Table (LUT)
Logic Functions SupportedAND, NAND, OR, NOR, XOR, XNOR, AND-OR, AND-OR-INVERT, Latches

LUTs (CLB)

AND, NAND, AND-OR, AND-OR-INVERT, OR-XOR, OR-XNOR, LatchesAny 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 peripheralsI/O pins, interrupt, other peripherals, other CLCsI/O pins, Event System
Other Features

Output mirror registers

Hardware counter (CLB)

Output mirror registersSynchronizer, filter, edge detector
Interrupt GenerationSupportedSupportedSupported
State Machine SupportSupported (CLB)Supported (through flip-flops, latches)Supported (through flip-flops, latches)
Event System IntegrationN/AN/ASupported
Low Power OperationSupportedSupported

Supported

(sleepwalking, event-driven)