Skip to content

Commit

Permalink
docs/psoc6/quickref.rst: Fix clock details in PDM section.
Browse files Browse the repository at this point in the history
Signed-off-by: NikhitaR-IFX <[email protected]>
  • Loading branch information
NikhitaR-IFX authored and actions-user committed Feb 4, 2025
1 parent 212dc39 commit 17291b9
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions docs/psoc6/quickref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -599,14 +599,30 @@ PDM - PCM bus
PDM/PCM is a asynchronous operation used to connect digital audio devices.
At the physical level, a bus consists of 2 lines: CLK, DATA.

PDM objects can be created and initialized using::
.. warning::
This is not part of the core MicroPython libraries. Therefore, not mapping any existing machine class API and neither supported by other ports.


The following specialization applies for configuring PDM-PCM bus in this port:

Before using the PDM-PCM bus, the clock frequency needs to be set. The PDM-PCM clock frequency can be set to 24.576 MHz or 22.579 MHz depending upon the sample rate. In order to set the frequency, use the following function:

::

machine.freq(AUDIO_PDM_24_576_000_HZ) # set the frequency of the clock to 24.576 MHz. For sample rates: 8 / 16 / 48 kHz
machine.freq(AUDIO_PDM_22_579_000_HZ) # set the frequency of the clock to 22.579 MHz. For sample rates: 22.05 / 44.1 KHz


PDM-PCM objects can be created and initialized using::

from machine import PDM_PCM
from machine import Pin

clk_pin = "P10_4"
data_pin = "P10_5"

machine.freq(AUDIO_PDM_24_576_000_HZ)

pdm_pcm = PDM_PCM(
0,
sck=clk_pin,
Expand Down Expand Up @@ -637,7 +653,7 @@ Constructor

- ``clk`` is a pin object for the clock line
- ``data`` is a pin object for the data line
- ``sample_rate`` specifies audio sampling rate
- ``sample_rate`` specifies audio sampling rate. It can be set to 8 / 16 / 48 KHz for which the clock frequency should be set to 24.576 MHz or to 22.05 / 44.1 KHz while clock should be set to 22.579 MHz.
- ``decimation_rate`` specifies PDM decimation rate
- ``bits`` specifies word length - 16, 18, 20, 24 being accepted values
- ``format`` specifies channel format - STEREO, MONO_LEFT or MONO_RIGHT
Expand Down

0 comments on commit 17291b9

Please sign in to comment.