35.6.2.4 Truth Table Inputs Selection

Input Overview

The inputs can be individually:

  • Masked
  • Driven by peripherals:
    • Analog comparator output (AC)
    • Timer/Counters waveform outputs (TC)
    • Serial Communication output transmit interface (SERCOM)
    • Timer/Counters for Control Applications waveform outputs (TCC)
  • Driven by internal events from Event System
  • Driven by other CCL sub-modules

The Input Selection for each input y of LUT n is configured by writing the Input x Source Selection bit in the LUT n Control register (LUTCTRLn.INSELx).

Masked Inputs (MASK)

When a LUT input is masked (LUTCTRLn.INSELx=MASK), the corresponding TRUTH input (IN) is internally tied to zero, as shown in this figure:

Figure 35-3. Masked Input Selection

Internal Feedback Inputs (FEEDBACK)

When selected (LUTCTRLn.INSELx=FEEDBACK), the Sequential (SEQ) output is used as input for the corresponding LUT.

The output from an internal sequential sub-module can be used as input source for the LUT, see figure below for an example for LUT0 and LUT1. The sequential selection for each LUT follows the formula:

I N [ 2 n ] [ x ] = SEQ [ n ]
I N [ 2 n +1 ] [ x ] = SEQ [ n ]

With n representing the sequencer number and x=0,1,2 representing the LUT input index.

Figure 35-4. Feedback Input Selection

Linked LUT (LINK)

When selected (LUTCTRLn.INSELx=LINK), the subsequent LUT output is used as the LUT input (e.g., LUT2 is the input for LUT1), as shown in this figure:

Figure 35-5. Linked LUT Input Selection

Internal Events Inputs Selection (EVENT)

Asynchronous events from the Event System can be used as input selection, as shown in the following figure. For each LUT, one event input line is available and can be selected on each LUT input. Before enabling the event selection by writing LUTCTRLn.INSELx = EVENT, the Event System must be configured first.

By default CCL includes an edge detector. When the event is received, an internal strobe is generated when a rising edge is detected. The pulse duration is one GCLK_CCL clock cycle. Writing the LUTCTRLn.INSELx = ASYNCEVENT will disable the edge detector. In this case, it is possible to combine an asynchronous event input with any other input source. This is typically useful with event levels inputs (external IO pin events, as example). The following steps ensure proper operation:

  1. Enable the GCLK_CCL clock.
  2. Configure the Event System to route the event asynchronously.
  3. Select the event input type (LUTCTRLn.INSEL=ASYNCEVENT).
  4. If a strobe must be generated on the event input falling edge, write a '1' to the Inverted Event Input Enable bit in LUT Control register (LUTCTRLn.INVEI) .
  5. Enable the event input by writing the Event Input Enable bit in LUT Control register (LUTCTRLn.LUTEI) to '1'.
Figure 35-6. Event Input Selection

I/O Pin Inputs (IO)

When the IO pin is selected as LUT input (LUTCTRLn.INSELx = IO), the corresponding LUT input will be connected to the pin, as shown in the figure below.

Figure 35-7. I/O Pin Input Selection

Analog Comparator Inputs (AC)

The AC outputs can be used as input source for the LUT (LUTCTRLn.INSELx = AC).

The analog comparator outputs are distributed following the formula:

IN[n][x]= AC[n % ComparatorOutput_Number]

With n representing the LUT number and x=[0,1,2] representing the LUT input index.

Before selecting the comparator output, the AC must be configured first.

Figure 35-8. AC Input Selection

Timer/Counter Inputs (TC)

The TC waveform output WO[0] can be used as input source for the LUT (LUTCTRLn.INSELx=TC). TCn, TC(n+1), and TC(n+4) are available respectively as default, alternative TC and second alternative TC selections (i.e., TC0, TC1 and TC4 are sources for LUT0, TC1, TC2 and TC5 are sources for LUT1, etc). See the figure below for an example for LUT0. More general, the Timer/Counter selection for each LUT follows the formula:

IN [ n ] [ x ] = D e f a u l t T C [ n ]
IN [ n ] [ x ] = A l t e r n a t i v e T C [ ( n + 1 ) ]
IN [ n ] [ x ] = S e c o n d A l t e r n a t i v e T C [ ( n + 4 ) ]

Where n represents the LUT number and x represents the LUT input index (x=0,1,2).

Before selecting the waveform outputs, the 33 Timer Counter (TC) must be configured.

Figure 35-9. TC Input Selection

Timer/Counter for Control Application Inputs (TCC)

The TCC waveform outputs can be used as input source for the LUT. Only WO[2:0] outputs can be selected and routed to the respective LUT input (i.e., IN0 is connected to WO0, IN1 to WO1, and IN2 to WO2), as shown in the figure below.

Note:

The TCC selection for each LUT follows the formula:

IN [ n ] [ x ] = T C C [ n % T C C_Instance_Number ] . W O [ x ]

Where n represents the LUT number and x represents the LUT input index (i=0,1,2).

Before selecting the waveform outputs, the TCC must be configured.

Note: TCC2 only outputs 2 WO signals, so TCC2.WO[0] is connected to both LUT2.IN[0] and LUT2.IN[2], and TCC2.WO[1] is connected to LUT2.IN[1].
Figure 35-10. TCC Input Selection

Serial Communication Output Transmit Inputs (SERCOM)

The serial engine transmitter output from Serial Communication Interface (SERCOM TX, TXd for USART, MOSI for SPI) can be used as input source for the LUT. The figure below shows an example for LUT0 and LUT1. The SERCOM selection for each LUT follows the formula:

IN [ n ] [ x ] = S E R C O M [ n % SERCOM_Instance_Number ]

With n representing the LUT number and x=0,1,2 representing the LUT input index.

Before selecting the SERCOM as input source, the SERCOM must be configured first: the SERCOM TX signal must be output on SERCOMn/pad[0], which serves as input pad to the CCL.

Figure 35-11. SERCOM Input Selection