■ SCREENSHOT 2. Multiple input
source configuration mappings can be
obtained by utilizing the alternate input
sources in the pull-down menus.
gates. Each of the four OR gate inputs
can be assigned as active inputs by
manipulating the associated CLC registers
in firmware. Every input to each of the
four OR gates can also be programmed
with an inverted output. In addition, the
outputs of the four gates can be configured
to invert their signals. CLC input sources
are programmable and include
PIC16(L)F1507 I/O pins, timers, internal
oscillators, internal PWM modules, and
the NCO (Numerically Controlled
Oscillator). In devices that contain multiple
CLC modules, the CLC outputs can be
used as inputs for other CLC modules.
The PIC16LF1507 — which will be the
object of our affection — contains a pair of CLC modules.
A CLC PRIMER
This is one of those rare times that I can actually bring
print to life. For us to keep the print hopping, go to the
Microchip website and download the CLC Designer
application. Once you have downloaded and installed CLC
Designer, you can physically duplicate the procedures I will
be executing with words and screenshots.
In Screenshot 1, I’ve kicked off CLC Designer and
selected the PIC16(L)F1507 as the target microcontroller. CLC
Designer does a bit more than just display the CLC gate
configurations and input connections. CLC Designer translates
the gate input sources and connections, along with the
selected logic configuration into CLC firmware that we can
simply paste into our C or assembler source code. Note that
we can assign any of the four input sources to any of the
four gates. In Screenshot 2, I’ve pulled down the topmost
source input menu to reveal the other gate input source options
at this level. We have a choice of both of the PIC16(L)F1507’s
I/O pin inputs plus the internal oscillator and the timers. The
remaining gate input selections are populated to allow a
large number of gate input source configurations.
■ SCHEMATIC 1.
I built this up on the
hardware has been
added to support
the PICkit3 as a
February 2012 53