29.9.4 CLB Configuration Steps
Configuration of the CLB consists of the following steps:
- Determine which of the CLB configuration modes will be used:
- Software Configuration
- Automatic Configuration on Start-up with CPU execution
- Automatic Configuration on Start-up with CPU halt
- Create the CLB bitstream using
the Microchip CLB Synthesizer:
- Select the inputs into the CLB using the CLB Input Selection latches
- Configure the Edge Detectors using the CLB Input Synchronizer latches
- Select the inputs into the BLEs using the BLE Input Selection latches
- Configure the BLE LUTs with entries corresponding to each expected input combination using the CLB LUT latches
- Configure the BLE output flops using the BLE Flop Select latches
- Configure the CLB interrupts using the CLB Interrupt Selection latches
- Determine which BLE output is routed to the eight PPS outputs using the CLB Output Selection latches
- Select the BLE outputs that control the Counter Stop and Counter Reset values using the Counter Stop and Counter Reset Control latches, respectively.
- Determine which counter bit is connected to the respective BLE Input using the Counter Output Selection latches
- Configure the CLB clock divider using the CLB Clock Divider latches
- Configure the CLB inputs to any peripherals used by the application.
- Configure CLB outputs using the CLBPPSOUT registers (see the "Peripheral Pin Select (PPS)" chapter).
- Select the CLB clock source using the CLBCLK register.
-
- If Software Configuration mode is used:
- Transfer the CLB bitstream to Program Memory using the Microchip CLB Synthesizer
- Configure the NVM Scanner to interact with the CLB module (refer to the “CRC” chapter for more details)
- Enable the scanner to load the CLB netlist values into the CLB latches
- Once the scanner has loaded the CLB configuration into NVM, enable the CLB module by setting the EN bit
- If either of the
Automatic Configuration on Start-up modes are used:
- Configure any other peripherals that are used by the application
- Ensure that the high address byte of the location in Program Memory of the CLB bitstream is loaded into the CLBSA bits of the Configuration Words
- Transfer the CLB bitstream to Program Memory using the Microchip CLB Synthesizer
- Enable the CLB module by setting the EN bit
- If Software Configuration mode is used:
The outputs of the CLB can be viewed through external pins via PPS, or by reading the CLBSWOUTH and CLBSWOUTL registers. The CLB outputs are also internally connected to other peripherals.
