Skip to content

Code example for "Getting Started with CLC on PIC18" Technical Brief : Using CLCs to create a Data Signal Modulator - MCC Generated Code

Notifications You must be signed in to change notification settings

microchip-pic-avr-examples/pic18f47q10-cnano-clc-flipflop-mcc

Repository files navigation

MCHP

PIC18F47Q10: Getting started with the CLC on PIC18 -> Using CLCs to Create a Data Signal Modulator -> MCC Generated code

Objective:

The PIC18F47Q10 features 8 Configurable Logic Cell (CLC) peripherals that can be used to implemenmt various logic functions. This example shows an initialization of the CLC in the JK flip-flop with R mode and AND-OR mode, that enables the implementation of a Data Signal Modulator (DSM) with timings controlled from the CCP peripheral.

Related Documentation

Existing application notes or tech briefs that are related to the subject:

Software Used

Hardware Used

Setup

The following configurations must be made for this project:

  • Timer 2 frequency = 1 MHz (1 us period)
  • Timer 4 frequency = 500 kHz (2 us period)
  • Timer 6 frequency = 62.5 kHz (16 us period)
  • CCP1 has as source Timer6 and duty-cycle = 50%

CLC Configuration:

  • CLC1 is set up as JK flip-flop


CLC1 Config

  • CLC2 is set up JK flip flop


CLC2 Config

  • CLC3 is set up as AND-OR


CLC3 Config

I/O configurations:

Pin Configuration
RA2 Digital Output
RA3 Digital Output
RB3 Digital Output
RB0 Digital Output


I/O pin mapping

This setup will create an internal connection as depicted:


Internal Depiction

Operation

Run the codegenerated by MCC, the following signals are to be seen on the oscilloscope:

In the figure below it is depicted the all the CLCs outputs and the CCP1 output side by side to show how this configuration implements DSM function:

  • Signal 1 (Yellow) is CCP1 output
  • Signal 2 (Green) is CLC1 output
  • Signal 3 (Blue) is CLC3 output
  • Signal 4 (Red) is CLC2 output


Figure A

Summary

This project showcases how the Core Independent Peripherals (CIPs) on the new PIC18-Q10 can be used to create an Data Signal Modulator (DSM). This example shows an initialization of the CLC in the JK flip-flop with R mode and AND-OR mode, that enables this implementation. The CLC is one of the most versatile peripherals in the PIC arsenal, and this example proves that the user can implement more modules with its help.

About

Code example for "Getting Started with CLC on PIC18" Technical Brief : Using CLCs to create a Data Signal Modulator - MCC Generated Code

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published