CLC Configuration Tool


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 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

CLCGUI_Highlight.png

1

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.

2

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.

3

Select the Data Inputs

There are four input selection groups. Each group consists of eight selections. For a device with only eight inputs, all the 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.

4

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.

5

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.

6

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.

7

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.

8

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.

CLCGUI_Output.png

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 copy 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.

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.

clcexample.png

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. Information on how to install the MCC Tool can be found by visiting the MPLAB Code Configurator (MCC) page.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.