Author: Elizabeth Roy, Microchip Technology Inc.

This application note describes a core independent method of measuring distance using an AVR® device and an ultrasonic transceiver. Many peripherals are configured to work together to perform measurements and present a result, independent of the CPU. The implementation is centered around the AVR Configurable Custom Logic (CCL) module and takes advantage of timer/counter Pulse Width Modulation (PWM) generation and uses timer/counter waveform generation for synchronized masking signals used for the transmit and receive lines of the ultrasonic transducer. The Analog Comparator (AC) and Digital-to-Analog Converter (DAC) are used to handle reception of the attenuated reflected signal. Timer capture is used to measure the ultrasonic burst's "time of flight" in order to measure proximity to a barrier.