µC generates a frequency burst
Abel Raynus, Armatron International Inc, Melrose, MA -- EDN, 2/3/2000
Pulse-sonar applications require generating bursts of a given frequency, duration, and repetition rate. Traditionally, the burst generator comprises a crystal oscillator with pulse modulation. But the easiest and cheapest way to generate the bursts is by using an inexpensive 8-bit µC, such as the 68HC705KJ1 and 68HC7051A (Motorola) and do the whole job using software. You can get additional benefits by outputting two signals in opposite phase to feed the ultrasonic transducer directly or via a push-pull buffer (Figure 1). Note that only two µC pins are necessary for burst generation. You can use the rest of the pins for different purposes.The highest frequency that the µC can generate depends on the value of the highest oscillator frequency, fOSC, that the manufacturer specifies and the structure of the instruction set, namely the quantity of machine cycles the µC takes to execute an instruction. With fOSC=4.00 MHz, the mentioned µCs can generate a maximum frequency of 58.8 kHz. This value is a good match for sonar projects because most of the ultrasonic transducers, working in an air medium, have a standard resonant frequency of 40 kHz. To lower the frequency from 58.8 to 40.0 kHz requires a simple delay of 4 µsec using nop and brn instructions.
The constant value in the counter "Number" determines the burst duration. With one 8-bit counter, the burst duration can range from 0.1 to 3.2 msec. If a longer burst is necessary, you can add one or two more counters. If you choose a duration of 1 msec, as in this case, the value to put into the counter is
![]() |
How you program the burst, repetition rate depends on the timer structure of the µC. For µCs with 16-bit programmable timers, the best way is to use either timer-overflow or output-compare functions. For µCs with multifunction timers, only the first eight timer stages are usable. Thus, timer overflow occurs every 0.51 msec, which is too short for a repetition period. So, you can use either real-time interrupt or, as in this case, organize a pacemaker based on the timer-overflow-interrupt. This design generates a burst every time the counter T rolls over from $FF to $00 with a repetition period of 131 msec. Click here to download the accompanying programs. (DI #2480)




