CLC Configuration Tool

Last modified by Microchip on 2023/11/09 09:03

Configurable Logic Cell (CLC) provides programmable logic that operates outside the speed limitations of software execution. The logic cell takes up to 16 input signals. Through the use of configurable gates, it reduces the 16 inputs to four logic lines that drive one of eight selectable single-output logic functions. The CLC can have its functionality pre-programmed or programmed dynamically. This provides greater flexibility and potential in embedded designs.

The CLC Configuration Tool’s purpose is to streamline the setup process of the CLC module by simulating the functionality of the registers in a Graphical User Interface (GUI). The end result of using the tool will be a generated source code, which can be dropped into an existing MPLAB® X IDE project file. The created code sample is custom generated, depending on your inputs and preferences, such as programming language.

The CLC Tool is part of the MPLAB Code Configurator (MCC) tool.

The video at the top of the page shows a step-by-step example of using the CLC Configuration Tool. A written step-by-step guide is below.

CLC GUI Setup Steps

CLC GUI Highlight

Select the Device

This is where the device, such as the PIC16F1508, will be selected. When a device is selected, the program will configure itself automatically to that specific device, such as data inputs and the number of available CLC outputs.

Select the CLC Number

A device can have multiple CLC's, so you will need to select the CLC number you want to set up. Some devices, such as the PIC10F320, will only have one available CLC module in the selected device. The “X” in each CLC register will be replaced by whichever CLC module is used.

Select the Data Inputs

There are four input selection groups. Each group consists of eight selections. For a device with only eight inputs, all eight inputs are available in every group. For a device with 16 inputs, only eight of the 16 are available in each group. However, these inputs are distributed in a way that minimizes precluding some input selection combinations. No input will appear twice in the same group but, it will appear as an input in other groups.

Gate Inputs

Once the data inputs are selected, they can be mapped into each of the four gates. The output of each gate will differ according to the logic function selected. To select input into a gate, simply hover over the desired “X” and click it once. The cursor arrow will have changed to the pointer and a line extending the input into the gate will appear. To invert the signal, click again where the “X” was and now a bubble should appear, indicating an inversion. If clicked once more, the bubble and line should disappear and default back to the original unconnected state.

Gate Outputs

Each of the gate outputs can be inverted. To do this, simply click once on the output of an individual gate for a bubble to appear. The output is now inverted. To undo this, click the bubble again for it to disappear. It is important to note that any gate with no inputs selected will have its output default to the "off" state, logic 0. If a constant logic 1 is desired, then invert the default logic 0 by clicking the output for the inverting bubble.

Select the Logic Block

There are eight available logic functions selected by the tabs of the CLC tool. The logic blocks cannot be configured to anything other than what is shown. Only one logic function can be used at a time for each CLC module.

Output Control

The output from the logic block is fed to the last stage of the CLC, the inversion gate. To invert the output, click on the buffer output pin once for a bubble to appear. From here, the output can be routed to other peripherals, an output pin, or back to the CLC input. An interrupt can be enabled upon the rising and/or falling edge from the CLC output. These functions are selected by checking the boxes in the lower right corner of the CLC tool screen.

Saving/Loading

The CLC Configuration Tool provides a convenient method for saving the design (or loading a previous design). When the design is concluded and ready to be implemented in software, click the File drop-down menu in the top-left corner of the dialog box.

CLC GUI Output

Then, click Save ASSY code or Save C code, depending on the desired output language. The code for all configured CLCs of the selected device will be included in the output file. The resultant file will have a .inc extension.

Both pieces of code produce the same effect. The Assembly is longer due to the nature of the language. The code can now be easily included as a library file or copied and pasted into an existing program.

  • Project Comments: Comments can also be saved and loaded within the output file. To do so, simply fill out the comments input text area as seen at the bottom of the CLC Configuration Tool screen before saving.
  • Loading an existing file: To load previously saved code from the CLC tool, click File > Load > Code. If imported successfully, the tool will have populated the GUI with the appropriate values corresponding to the registers in the loaded code.

Back to Top

Example

Here is a simple example created with the CLC Configuration Tool. It shows that the eight registers have been set up in software to create the CLC setup shown in the picture.

CLC Example

Back to Top

Download/Documentation

The CLC Configuration Tool is part of the MPLAB Code Configurator. You can get the CLC Configuration Tool, User Manual, and CLC Tips and Tricks Guide directly from the links below:

The CLC Tool is now incorporated into the MPLAB Code Configurator (MCC) Tool. 

Back to Top