Introduction

Author: Gheorghe Turcan, Microchip Technology Inc.

The Microchip AVR® DA MCU family of microcontrollers features up to three Zero-Cross Detectors (ZCD) with flexible input selection, requiring only one external component, and configurable output (interrupts on rising/falling or both edges, event generation, and output inversion).

This technical brief explains the concepts of the ZCD and its implementation in the AVR DA family of microcontrollers with the following use cases:

  • Free-Running to External I/O

    This example shows how to use the ZCD to detect when the zero value of an analog signal is reached (for example, the zero-cross of the Alternating Current mains electricity).

  • AC Signal Frequency Detection

    This example describes how to use the ZCD together with a timer to measure the pulse duration and/or the period of analog signals with minimal intervention of the CPU.

  • Active Bridge Control Signal Generation

    This example describes how to use the ZCD together with the CPU to create a Pulse Width Modulated (PWM) and inverted PWM depiction of the Alternating Current (AC) signal, to control an active bridge.

Note: The code examples were developed using the AVR128DA48 Curiosity Nano board.