Exploring the Essentials of ATtiny Configurable Custom Logic (CCL) Setup
Utilizing Configurable Custom Logic (CCL) in ATtiny Microcontrollers
In the realm of Microchip's tinyAVR microcontroller series, the Configurable Custom Logic (CCL) stands out as a significant feature among the Core Independent Peripherals (CIP). A YouTube video by Grug Huhler demonstrates how to create custom digital logic circuits in hardware using the ATtiny's CCL peripheral.
For those with spare pins on their tinyAVR micro, the CCL provides an opportunity to utilize these pins for "glue logic," reducing the bill of materials (BOM) cost. The CCL is capable of performing simple to moderately complex logic tasks without the processor core's support, making it a core independent peripheral.
Microchip's Technical Brief TB3218, "Getting Started with Configurable Custom Logic (CCL)," is a valuable resource for understanding the capabilities of the CCL in these tinyAVR series. Alternatively, the ATtiny3226 datasheet, mentioned in the video, offers more detailed information.
A tinyAVR micro will typically come equipped with one or two CCL peripherals, depending on the series. These peripherals rely on two Lookup Tables (LUTs) as their core hardware. Each LUT can map any three binary inputs into one binary output, enabling programming with a single byte for 2-input or 3-input logic, such as NOT, AND, OR, XOR, and more. The LUT output can also be filtered, synchronized, and piped through an Edge Detector and a Sequencer (always from the lower numbered LUT in the pair). Additionally, LUT inputs can be masked out.
Grug Huhler's accompanying source code for the video features a demonstration of a three-input AND gate, an SR Latch using the sequencer, an SR Latch using feedback, and a filter/sync and edge detection circuit. The Arduino library used is Logic.h from megaTinyCore.
In previous coverage on our website, we've explored the use of AVR microcontrollers to create a switching regulator.
To leverage the capabilities of CCL within ATtiny microcontrollers like the ATtiny412, one can follow the steps below when using the megaTinyCore and Logic.h library:
- Set up megaTinyCore in the Arduino IDE.
- Include the Logic.h library.
- Define logic gates.
- Configure gate outputs.
- Upload and test.
With these steps, digital logic circuits can be created inside the microcontroller without requiring external components, helping offload simple combinational logic tasks and reducing software overhead.
The ATtiny's Configurable Custom Logic (CCL) peripheral, demonstrated in Grug Huhler's YouTube video, can be utilized for creating custom digital logic circuits in hardware, reducing the need for external components. This technology, relying on two Lookup Tables (LUTs), allows for programming of 2-input or 3-input logic, such as NOT, AND, OR, XOR, using a single byte. Furthermore, the Arduino library Logic.h from megaTinyCore can be employed when leveraging the CCL within ATtiny microcontrollers for building digital logic circuits internally.