Hardware layout and configuration
UM2032
22/40
UM2032 Rev 3
5.8 Audio
codec
An audio codec U15 connected to the I2S3 interface of the microcontroller
STM32F412ZGT6 offers the possibility to connect a stereo headphone or headset with a
mono-analog microphone. A loudspeaker can be connected to the extension connector.
The digital audio output from the microcontroller is handled by the port of the microcontroller
PB5 called CODEC_I2S3_SD while the other direction is handled by port PB4 called
CODEC_I2S3ext_SD.
The I
²
C-bus address of the codec is 0b0011010.
5.8.1 Stereo
headset and headphone jack
A stereo headphone or a stereo headset with analog microphone can be plugged into the
3.5 mm standard jack socket CN9.
The stereo digital audio streamed from pin PB5 of the microcontroller STM32F412ZGT6 is
transformed in a stereo analog output by the codec and is delivered to the headphone or
headset through the pins 6 and 4 of the jack socket CN9.
If a headset is plugged into CN9, the bias of the microphone is driven by the output
MICBIAS1 of the codec and the analog audio enters into the codec by the pin IN1LN.
The corresponding digital audio output from the codec is connected to the microcontroller
STM32F412ZGT6 by the port PB4.
5.8.2 Loudspeaker
output
The 32F412GDISCOVERY Discovery kit can deliver a monophonic audio to a loudspeaker
connected to pins 36 and 38 of the extension connector P2. It is recommended to use the
codec loudspeaker outputs SPKOUTRN and SPKOUTRP in linear mode called "class AB".
This mode is compatible with 4-ohm to 8-ohm impedance loudspeakers. Use of the
switching mode called "class D" requires to use an appropriate filter to maximize rejection of
unwanted frequencies and efficiency. To select the mode "class AB" of the codec, set to 1
the bit 8 of the register 0x23.
5.9 Digital
microphones
Two digital microphones U4 and U5 are available on the 32F412GDISCOVERY Discovery
kit. The two microphones are located at a distance of 21 mm each other. The microphones
are connected to the DFSDM of the STM32 by the port PC2 generating the clock and by the
port PB1 collecting the PDM interleaved data.
5.10
USB OTG FS
A USB OTG full-speed communication is available at USB Micro-AB receptacle connector
CN3.
Limitations:
the USB-related operating supply voltage of STM32F412ZGT6 (VDD_USB
line) must be within the range from 3.0 V to 3.6 V. Therefore, in case the STM32F412ZGT6
is supplied with 2 V by JP5 set in +2 V position, the USB of the STM32 works only if the
VDD_USB power pin is supplied independently by +3.3 V. This is done by closing pins 2
and 3 of the jumper JP6 (refer to
Table 4: Power-supply-related jumper settings
).