
Getting Started with CapSense
®
Document No. 001-64846 Rev. *I 29
2.7.3 Audible Feedback
Audible feedback for CapSense buttons is implemented using a buzzer. The pulse-width modulator (PWM) is used to
output the PWM signal required for driving the buzzer as specified in the buzzer datasheet. The PWM user module
available in PSoC is used for this purpose. PSoC can implement CapSense through its CSA and CSD algorithms.
The CSD user module is configured to scan a set of buttons and sliders. When a button press event occurs, the
feedback is given by driving the buzzer at a particular intensity level. The circuit diagram for implementing the buzzer
feedback follows.
Figure 2-30. Implementing Audible Feedback for CapSense in CapSense Plus/CapSense Express Devices
2.7.3.1 CapSense with Audible Feedback Configuration
Select CSD and PWM8 user module from the user module list. Set the parameters for the CSD user module as
shown in Table 2-1. Calculate the PWM user module parameters based on the buzzer‘s resonant frequency. For
example, consider the buzzer CD1206 with a resonant frequency of 2.4 kHz. A 2.4-kHz PWM signal with a 50-
percent duty cycle is required to drive the buzzer to produce proper audio feedback.
Figure 2-31. PWM Clock Divider Calculation
To calculate the clock dividers to obtain a 2.4-kHz PWM output, see Figure 2-31.
The system clock is set to 24 MHz. The required PWM output frequency is 2.4 kHz. For this reason:
Equation 11
Where, N1 and N2 are the VC1 and VC2 clock divider values, respectively. Period Value is the value of period
register input to the PWM.
That means:
Equation 12
Komentarze do niniejszej Instrukcji