How to Create a Rising Edge Detector

Last modified by Microchip on 2025/01/02 09:13

Overview

Edge detection is a key technique for identifying signal changes from low to high, known as a rising edge, to trigger specific actions. It ensures precise timing and accurate responses in applications like event triggering, timing analysis, and signal synchronization. By reliably detecting these transitions, edge detection enables systems to respond promptly and maintain high precision.

The Configurable Logic Block (CLB) has built-in edge detectors that automatically synchronize input signals with the CLB clock. When an external signal enters unsynchronized, the edge detectors align it with the internal clock, ensuring stable transitions and reducing timing issues.

Figure 1: Rising Edge Detector Circuit

Figure 1: Rising Edge Detector Circuit

Requirements

Procedure

Implement the CLB Logic

Configure the CLB to implement flip-flops, AND gates, or equivalent logic for the rising edge detector. Refer to Figure 1 for guidance.

Information

Note: If using MPLAB® Code Configurator (MCC), use the CLB Synthesizer tool or download the pre-configured CLB file.

Back to Top


Select a Clock Source for the CLB

Set the CLB to use the LFINTOSC clock source.

Back to Top


Assign Pins

Connect the input of the logic to the signal where you want to detect a rising edge, and route the output, which represents the detected rising edge, to the desired destination in your system.

Back to Top


Verify the Design

Confirm the rising edge functionality using a debugging tool to ensure proper operation.

Back to Top

Results

This screenshot shows the output of the riding edge detection circuit. This circuit uses a combination of flip-flops, AND gates, and inverters to store the input signal's state and generate a pulse at the transition, detecting rising edges of the input signal. The rising edge detection output (D1) correctly responds to the transitions in the input signal (D0), providing clear, distinct pulses for each detected rising edge.

Figure 2: Rising Edge Detector Output

Figure 2: Rising Edge Detector Output

Back to Top

Learn More

Back to Top