在AT89C51SND1C的datasheet中对音频部分有如下解释: The data converter block converts the audio stream input from the 16-bit parallel format to a serial format. For accepting all PCM formats and I2S format, JUST4:0 bits in AUDCON0 register are used to shift the data output point. As shown in Figure 13-4, these bits allow MSB justification by setting JUST4:0 = 00000, LSB justification by setting JUST4:0 = 10000, I2S Justification by setting JUST4:0 = 00001, and more than 16-bit LSB justification by filling the low significant bits with logic 0.
In voice or sound playing mode, the audio stream comes from the C51 core through an audio buffer. The data is in 8-bit format and is sampled at 8 kHz. The audio buffer adapts the sample format and rate. The sample format is extended to 16 bits by filling the LSB to 00h. Rate is adapted to the DAC rate by duplicating the data using DUP1:0 bits in AUDCON1 register according to Table 73.
The audio buffer interfaces to the C51 core through three flags: the sample request flag (SREQ in AUDSTA register), the under-run flag (UNDR in AUDSTA register) and the busy flag (AUBUSY in AUDSTA register). SREQ and UNDR can generate an interrupt request as explained in Section "Interrupt Request", page 76. The buffer size is 8 Bytes large. SREQ is set when the samples number switches from 4 to 3 and reset when the samples number switches from 4 to 5; UNDR is set when the buffer becomes empty signaling that the audio interface ran out of samples; and AUBUSY is set when the buffer is full.
问题1:audio buffer是16位的,如果WAV文件是按8位采样,扩展成16位,用程序实现,还是硬件自动完成? 问题2:16位数据是先写低8位还是先写高8位? 问题3:如何播放单声道wav文件?好像at89c51snd1c默认按双声道处理. 问题4:"DUP1:0"到底是什么意思?DAC的速度与此有什么关系? |