STM32L4串行音频接口模块(SAI)介绍
STM32L4串行音频接口模块(SAI)介绍
SAIx
APB Interface
SYNC
Sync Out
OUT
Sub-Block A
IO Line Management
Sub-Block A 8 x 32b Interface SCK_A
PLL_P SD_A
MCLK_A
PLLSAI1_P
PLLSAI2_P
Sub-Block B FS_B
SAIxEXTCLK
Clock generator FIFO Serial SCK_B
SD_B
SAI_CK_B Sub-Block B 8 x 32b Interface
MCLK_B
SYNC
Sync In
IN
APB Interface
SAIx
APB Interface
Sync Out
Sub-Block A
Sub-Block B FS_B
Clock generator FIFO Serial SCK_B
SD_B (I/O)
SAI_CK_B Sub-Block B 8 x 32b Interface
MCLK_B
Sync In
APB Interface
SYNC
OUT
IO Line Management
• SLAVE full-duplex or dual lane
SYNC
IN
48
SAI: External Synchronization examples (2/3) Interrupt TX or RX - SLAVE DMA
SAI2
APB Interface
Sync Out
Sub-Block A
STM32L476/486
Interrupt TX or RX - MASTER DMA
Request Request Synchro !!!
SAI1
APB Interface
Sub-Block A
Sub-Block B FS1_B
SCK1_B
Clock generator FIFO Serial
SD1_B (IO)
SAI_CK_B Sub-Block B 8 x 32b Interface
MCLK1_B
Sync In
APB Interface
=
256 =
+1
_ (1)
=
2 × = _
(1)
When MCKDIV = 0
FMCLK = FSAI_CK
• Data format:
• The data register must contain CS,U and V bits, plus the data
X Y Z Y X Y X Y Z Y
M Ch A W Ch B B Ch A W Ch B M Ch A W Ch B M Ch A W Ch B B Ch A W Ch B
Sub-frame Sub-frame
• Preambles
• The preambles are ‘violating’ the biphase-mark code rules
0 1 2 3
1 UI 2 UI 3 UI 4 UI 5 UI 6 UI 7 UI 8 UI
Previous half-bit = 0
Preamble “B”
Previous half-bit = 1
Missing Transitions !!!
Previous half-bit = 0
Preamble “M”
Previous half-bit = 1
Previous half-bit = 0
Preamble “W”
Previous half-bit = 1
02/07/2015 STM32F7xx Technical Training 66
AC’97 protocol(1/2)
• The SAI is able to work as an AC’97 link controller.
– To select the AC 97 protocol, set bit PRTCFG[1:0] in the
SAI_xCR1 register to 10.
• The number of slot is fixed to 13 slots:
– Tag slot :slot 0 (16-bit),
– Data slots: slot 1 to slot 12 (20-bit)
Bit FBOFF[5:0] in the SAI_xSLOTR register is ignored
• The frame length is fixed to 256-bit
The SAI_xFRCR register is ignored
FS (SYNC)
CMD CMD PCM PCM LINE 1 PCM PCM PCM PCM LINE2 HSET IO
DATA_Out TAG
ADDR DATA Center L.SUPR R.SUPR LFE DAC DAC CTRL
TAG
L.Front R.Front DAC
This detection and flag assertion can detect glitches on the SCK
Clock/FS due to a noisy environment
MSb
MSb
LSb
LSb
72
CONFIDENTIALITY OBLIGATIONS:
IT IS CLASSIFIED “MICROCONTROLLERS, MEMORIES & SECURE MCUs (MMS) RESTRICTED AND ITS DISTRIBUTION IS SUBMITTED TO ST/MMS
AUTHORIZATION
AT ALL TIMES YOU SHOULD COMPLY WITH THE FOLLOWING SECURITY RULES:
- DO NOT COPY OR REPRODUCE ALL OR PART OF THIS DOCUMENT
- KEEP THIS DOCUMENT LOCKED AWAY
- FURTHER COPIES CAN BE PROVIDED ON A “NEED TO KNOW BASIS”, PLEASE CONTACT YOUR LOCAL ST SALES OFFICE OR
DOCUMENT WRITTER.
Information furnished is believed to be accurate and reliable. However, STMicroelectronics assumes no responsibility for the consequences of use of
such information nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted by implication or
otherwise under any patent or patent rights of STMicroelectronics. Specifications mentioned in this publication are subject to change without notice.
This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not authorized for use as critical
components in life support devices or systems without express written approval of STMicroelectronics.
The ST logo is registered trademark of STMicroelectronics
All other names are the property of their respective owners
© 2015 STMicroelectronics - All Rights Reserved
STMicroelectronics group of companies Australia - Brazil - Canada - China - Finland - France - Germany - Hong Kong -
India - Israel - Italy - Japan - Malaysia - Malta - Morocco - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States.
www.st.com