Pulse Code Modulation (PCM) Appendix#
This appendix provides key terminology, acronyms, examples, and troubleshooting guidance for working with Pulse Code Modulation (PCM) on the SiWx917 platform. Use it as a quick reference for hardware signal definitions, software integration terms, and common debugging procedures.
Glossary#
This glossary defines the most common PCM terms, signals, and software concepts used in Silicon Labs audio development.
Term | Definition |
|---|---|
PCM (Pulse Code Modulation) | A synchronous digital audio protocol that represents analog audio samples as fixed-width digital words transmitted at a fixed sampling rate. |
Sample Rate | Number of audio samples transmitted per second (for example, 8 kHz, 16 kHz, or 32 kHz). Determines the bandwidth and quality of PCM audio. |
Word Size / Data Size | Number of bits used to represent each PCM sample (16, 24, or 32 bits on SiWx917). |
Frame Sync (FSYNC) | Signal that marks the start of a PCM frame. Used to align sample boundaries. |
Bit Clock (BCLK) | Clock signal that shifts out each bit of the PCM word. Derived from sample rate × word size. |
DIN | “Data In” — Serial input data line carrying audio samples into SiWx917. |
Bit Depth (Resolution) | Bits used to represent each sample (for example, 16-bit, 24-bit, or 32-bit). |
DOUT | “Data Out” — Serial output data line carrying audio samples from SiWx917 to an external device. |
Primary Mode | SiWx917 generates PCM clocks (FSYNC and BCLK) and acts as the timing source. |
Secondary Mode | SiWx917 receives PCM clocks from an external device and synchronizes its data transfers. |
DMA (Direct Memory Access) | Hardware unit that moves PCM samples between memory and PCM FIFOs without CPU intervention, improving throughput and reducing underrun/overrun risk. |
FIFO (First-In, First-Out Buffer) | Hardware buffer used to temporarily store TX/RX audio samples, smoothing timing between CPU/DMA and PCM shift engine. |
Underrun | Occurs when TX FIFO empties before new data arrives, causing missing output samples. |
Overrun | Occurs when RX FIFO fills faster than the application/DMA can consume data, causing lost incoming samples. |
HP Domain | High-Performance domain where PCM operates. PCM is active in PS4/PS3 but does not function in deep low-power modes (PS2/PS1). |
Acronyms#
The following table defines abbreviations and technical terms used throughout PCM documentation.
Acronym | Definition |
|---|---|
PCM | Pulse Code Modulation |
BCLK | Bit Clock |
FSYNC | Frame Synchronization |
DMA | Direct Memory Access |
UDMA | Universal Direct Memory Access |
FIFO | First-In, First-Out |
ADC | Analog-to-Digital Converter |
DAC | Digital-to-Analog Converter |
ULP | Ultra-Low Power |
HP | High Performance |
PS1/PS2 | Power State 1 / Power State 2 |
PS4 | Power State 4 |
GPIO | General-Purpose Input/Output |
API | Application Programming Interface |
SDK | Software Development Kit |
SiWx917 | Silicon Labs Wi-Fi SoC Family |
Si91x | Silicon Labs SoC Family |
DEBUGINIT | Debug Initialization Macro/Function |
SoC | System on Chip |
IDE | Integrated Development Environment |
MEMS | Micro-Electro-Mechanical Systems |
DSP | Digital Signal Processor |
TDM | Time Division Multiplexing |
PDM | Pulse Density Modulation |
VoIP | Voice over Internet Protocol |
IoT | Internet of Things |
RTOS | Real-Time Operating System |
Extended Examples#
The following PCM examples are available in the WiSeConnect SDK. Use them as reference implementations for configuring and validating PCM features on the SiWx917.
sl_si91x_pcm_primary – Demonstrates Primary (Controller) mode.
sl_si91x_pcm_secondary – Demonstrates Secondary (Target) mode.
sl_si91x_pcm_loopback – Tests full-duplex PCM transmit and receive using internal loopback.
FAQ#
Q1: What is Pulse Code Modulation (PCM)?#
PCM is a method of converting analog audio signals into a digital stream of samples. Each sample represents the amplitude of the signal at a given time. On the SiWx917, PCM supports up to 192 kHz sample rate and operates in the High-Performance (HP) domain.
Q2: How do I enable PCM on the SiWx917 platform?#
PCM operates in the HP domain and is active in PS4 and PS3 power states.
Add the PCM component in Simplicity Studio.
Configure the peripheral using the Universal Configurator (UC).
Initialize PCM with
sl_si91x_pcm_init().
Q3: What should I do before entering a sleep state?#
Before entering low-power mode:
Stop active PCM streams.
Flush audio buffers.
Disable DMA (if used).
Deinitialize PCM using
sl_si91x_pcm_deinit().
Q4: How can I recover from PCM underruns or glitches?#
Reset and reinitialize PCM to restore clean operation:
sl_si91x_pcm_deinit(PCM_INSTANCE);
sl_si91x_pcm_init(PCM_INSTANCE, &config);Q5: What error codes are returned by PCM APIs?#
Error Code | Meaning |
|---|---|
SL_STATUS_OK | Operation successful |
SL_STATUS_FAIL | General failure |
SL_STATUS_TIMEOUT | Operation timed out |
SL_STATUS_INVALID_PARAMETER | Invalid configuration |
SL_STATUS_BUSY | Peripheral currently in use |
Q6: How can I debug PCM audio issues?#
Use a logic analyzer to observe BCLK, FSYNC, DIN, and DOUT signals.
Verify clock phase, polarity, and frame alignment.
Check buffer sizes for underrun/overrun conditions.
In Simplicity Studio, use:
Peripheral configuration and Power Analysis views.
RTOS-aware debugging to trace callback behavior.
Q7: What sample rates and bit depths are supported?#
Sample Rates: 8 kHz to 192 kHz.
Bit Depths: 16-bit, 24-bit, 32-bit.
Channel Configurations: Mono or Stereo.
Q8: How do I choose the right buffer size?#
Real-time audio: 64–256 samples for low latency.
Streaming audio: 512–2048 samples for stability.
High-performance audio: 1024+ samples for continuous playback.
Tip: Adjust FIFO thresholds and DMA burst size to balance latency and throughput.
Q9: What causes underruns and overruns?#
Underruns: Occur when data is not ready for transmission in time.
Overruns: Occur when incoming data exceeds buffer capacity.
Solutions: Increase buffer size, enable DMA, optimize ISR priority, or reduce sample rate.
References#
For further information and development examples, see: