3 Implementation
The functionality of the Core Independent Ultrasonic Distance Measurement application is centered around the Configurable Custom Logic (CCL) module. It enables input MUXing to two Lookup-Tables (LUTs) with configurable logic. In this application, one LUT is used to control the transmit line of the ultrasonic transducer, and the other is used to filter the receive line. "Time of flight" can be measured by feeding both LUT outputs into a sequential control block, specifically an SR latch. The result is that the output of the latch indicates "time of flight". This setup can be seen in the figure below.
- Signal (1) is the output from timer/counter type A, which is set up to produce an approximate 40 kHz PWM
- Signal (2) is a mask produced by timer counter type D, set up to be low when an ultrasonic burst should be emitted, and the rest of the time high
- These two signals are the inputs to LUT1, the output of which (1 & !2) is connected to the transmit line of the ultrasonic transducer
- Signal (3) is a mask produced by timer counter type D, set up to be low when the receive line is enabled, and high when transmitting. The transmission will be picked up by the receive line of the ultrasonic transducer and needs to be masked because it will be erroneously detected as the reflected signal. It extends slightly past the transmission length to account for resonance. Because both masking signals (2 and 3) are produced by the same timer, they are synchronized and therefore the transmission is effectively masked from the receive line.
- Signal (4) represents the activity on the receive line, after being processed by the analog comparator
- These two signals are the inputs to LUT0, the output of which (!3 & 4) represents the filtered receive line, only containing pulse reflections