How to Create a Falling Edge Detector

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

Overview

Edge detection is a key technique for identifying signal changes from high to low, known as a falling 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: Falling Edge Detector Circuit

Figure 1: Falling Edge Detector Circuit

Requirements

Procedure

Implement the CLB Logic

Configure the CLB to implement flip-flops, AND gates, or equivalent logic for the falling 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 falling edge, and route the output, which represents the detected falling edge, to the desired destination in your system.

Back to Top


Verify the Design

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

Back to Top

Results

Figure 2 shows the output of the falling 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 falling edges of the input signal. The falling edge detection output (D1) correctly responds to the transitions in the input signal (D0), providing clear, distinct pulses for each detected falling edge.

Figure 2: Falling Edge Detector Output

Figure 2: Falling Edge Detector Output

Back to Top

Learn More

Back to Top