NO:
W90P710 Programming Guide
VERSION:
2.0
PAGE:
136
The above information is the exclusive intellectual property of Winbond Electronics and shall not be disclosed, distributed or reproduced without permission
from Winbond.
Table No.: 2005-W90P710-11-A
1.
Set the
IIS_AC_PIN_SEL
,
AUDIO_EN, AUDCLK_EN
,
ACLINK_EN
,
PFIFO_EN
,
T_DMA_IRQ
, and
DMA_EN
bits of
ACTL_ACCON
(
IIS_AC_PIN_SEL: select I2S or
AC97, AUDIO_EN: enable
W90P710
audio controller, ACLINK_EN: enable
W99P710
AC-link interface, PFIFO_EN: enable playback FIFO, T_DMA_IRQ: enable transmit DMA
complete IRQ, and DMA_EN: enable DMA transfer)
2.
If left and right channels data want to be played, write
0x3
to
PLAY_SINGLE[1:0]
of
ACTL_RESET
register. If left channel only data want to be played, write
0x1
to
PLAY_SINGLE[1:0]
of
ACTL_RESET
register. If right channel only data wants to be
played, write
0x2
to
PLAY_SINGLE[1:0]
of
ACTL_RESET
register
3.
Pull
ACTL_RESET_BIT
bit of
ACTL_RESET
register high for 10ms to reset W90P710
audio controller. And pull
AC_RESET
bit of
ACTL_RESET
register high for 10ms to
reset W90P710 AC97 interface.
4.
Reset the external AC97 codec.
5.
Install interrupt service routine and enable W90P710 audio controller play interrupt. The
play IRQ number is 6.
6.
Program AC97 codec playback sampling rate. (refer to AC97 specification)
7.
Allocate memory for playback DMA buffer, its base address must be 4 bytes aligned.
8.
Write base address of playback DMA buffer to
ACTL_PDSTB
register with
bit 31
set
(indicates it is non-cacheable region), and write the DMA buffer length to
ACTL_PDST_LENGTH
register
9.
Fill DMA buffer with PCM data to be played and then set AC_PLAY bit of
ACTL_RESET
register to start playback
10.
In playback ISR, check
ACTL_PSR
register. If
P_DMA_MIDDLE_IRQ
bit was set, fill
PCM data to the first half of DMA buffer. Otherwise, if
P_DMA_END_IRQ
bit was set, fill
PCM data to the second half of DMA buffer
11.
After all PCM data has been played, clear the AC_PLAY bit of
ACTL_RESET
register to
stop playback