PSoC 6 PDM-PCM Converter: Generate Desired Sampling Rate
Several of the PSoC 6 variants include a PDM-PCM converter. This allows the MCU to easily interface with a PDM microphone, converting the 1-bit PDM stream to 16-, 18-, 20-, or 24-bit PCM output data. The rate at which these PCM samples arrive is the sampling frequency (fs) and it is configurable via ModusToolbox. However, in the Device Configurator you cannot directly enter the desired sampling rate (as you would the Baud Rate when configuring one of the UARTs), but rather you must configure the peripheral clock and decimation rate to produce the correct fs.
The Cypress Semiconductor CY8CPROTO-062-4343W PSoC 6 Wi-Fi/Bluetooth evaluation board. (Image source: Cypress Semiconductor)
The Architecture Technical Reference Manual (TRM) provides several example configurations for five standard audio sampling rates, including the familiar 44100 Hz. Unfortunately, with the CY8CPROTO-062-4343W board this process is not entirely straightforward because the ECO crystal on the board is different than that in the TRM example and is considered an invalid value by the Device Configurator. For a detailed look at how to generate a desired sampling rate (44100 Hz in this example) and get around the CY8CPROTO-062-4343W complications, see the article “Sampling Audio at 44.1 kHz with the CY8CPROTO-062-4343W Board.”