When using the HT46 A/D type MCUs in smoke detector alarm applications, how is the alarm frequency changed when driving buzzers?
Answer To change the frequency in alarm signals first determine the frequency range. For example if it is 2kHz to 4kHz, then the frequency high and low value will determine the tone high and low value. Then determine the sampling period. From an output frequency of 2kHz increasing to 4kHz, and then returning to 2kHz completes one alarm sound period. The sound wave period length determines the sound rapidity. In this period the output frequency change does not continuously change, but rather in stages. For example from 2kHZ~4kHz, within the 2kHz range, if 100 samples are chosen then 2kHz/100 = 20Hz, means that for each sample the frequency will change by 20Hz. Within one period, more samples will result in a more continuous and refined sound. For example if the sound period is 0.4s, then the sampling period is 0.4s/200 = 2ms which means that each frequency will be transmitted for 2ms before changing. When the principle of changing frequency is understood, then the I/O port or the PFD ca