Skip to content

Commit b30d102

Browse files
NikhitaR-IFXactions-user
authored andcommitted
docs/psoc6/quickref.rst: Fix clock details in PDM section.
Signed-off-by: NikhitaR-IFX <nikhita.rajasekhar@infineon.com>
1 parent 3f2ffa3 commit b30d102

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

docs/psoc6/quickref.rst

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,14 +599,30 @@ PDM - PCM bus
599599
PDM/PCM is a asynchronous operation used to connect digital audio devices.
600600
At the physical level, a bus consists of 2 lines: CLK, DATA.
601601

602-
PDM objects can be created and initialized using::
602+
.. warning::
603+
This is not part of the core MicroPython libraries. Therefore, not mapping any existing machine class API and neither supported by other ports.
604+
605+
606+
The following specialization applies for configuring PDM-PCM bus in this port:
607+
608+
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:
609+
610+
::
611+
612+
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
613+
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
614+
615+
616+
PDM-PCM objects can be created and initialized using::
603617

604618
from machine import PDM_PCM
605619
from machine import Pin
606620

607621
clk_pin = "P10_4"
608622
data_pin = "P10_5"
609623

624+
machine.freq(AUDIO_PDM_24_576_000_HZ)
625+
610626
pdm_pcm = PDM_PCM(
611627
0,
612628
sck=clk_pin,
@@ -637,7 +653,7 @@ Constructor
637653

638654
- ``clk`` is a pin object for the clock line
639655
- ``data`` is a pin object for the data line
640-
- ``sample_rate`` specifies audio sampling rate
656+
- ``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.
641657
- ``decimation_rate`` specifies PDM decimation rate
642658
- ``bits`` specifies word length - 16, 18, 20, 24 being accepted values
643659
- ``format`` specifies channel format - STEREO, MONO_LEFT or MONO_RIGHT

0 commit comments

Comments
 (0)