3.2 CCL

Configurable Custom Logic (CCL) is a programmable logic block that can use the device port pins, internal peripherals, and the internal Event System as both input and output channels.

As a Core Independent Peripheral (CIP), the CCL can serve as a programmable glue logic, which allows users to eliminate logic gates for simple glue logic functions on the PCB. This increases the reliability of the PCB by reducing its complexity, and also helps to keep the BOM down.

In ATtiny817, the CCL includes two programmable look-up tables (LUT). Each LUT consists of three inputs, a truth table, and as options, synchronizer, filter, and edge detector. Each LUT can generate an output as a user-programmable logic expression with three inputs. The inputs can be individually masked.

For more detail about this peripheral, refer to the latest data sheet of ATtiny817, available at http://www.microchip.com/.

Figure 3-2. Configurable Custom Logic Block Diagram

In this application, LUT1 is configured to generate a control signal to the ultrasonic transmitted pulses, while LUT0 is set to receive the reflected ultrasonic echo data. Mask signals from the Timer TCD can be used to avoid an overlap conflict between the transmitting period and the receiving period. Travel time can be measured by feeding both LUT outputs into a sequential control block, specifically an SR latch. The result is that the output of the latch indicates the travel time. See the figure below for more details.

Figure 3-3. CCL Logic Application

The pin selection for CCL in this design is shown in the table below.

Table 3-1. Configurable Custom Logic Pin Description
Pin NameFunctionSelected Pin in MCU
LUT1-OUTOutput for transmitted signalPC1

For more details about the firmware algorithm and configuration, refer to the firmware user guide available at http://www.microchip.com/.