Description Of Software; Usb Playback Sample; Operation; Pcm Data Transfer - Renesas RX231 User Manual

Rx200 series, hear-it! solution kit for e2 studio
Hide thumbs Also See for RX231:
Table of Contents

Advertisement

Hear-it! Solution Kit

6. Description of Software

The choice between USB audio playback and streaming from line-in or MIC input is achieved through conditional
compilation of the application software project. Refer to section 5.3 for details of the conditional compilation
required to change operating modes.
6.1

USB Playback Sample

6.1.1

Operation

After reset, the sample waits for a USB mass storage device to be connected to the USB connector CN9. Once
this occurs, the user is first presented with a list of available .wav files in the 'Music' folder. The user can choose
an audio file from the list by using the potentiometer and pressing SW3 to select. Once the file has been selected,
file playback is paused so that the user can adjust the volume to a suitable level, using the pot R43 (as the pot
has just been used to select the file, the volume may start at a surprising level). Pressing switch SW3 starts
playback of the file, and SW3 can then be used to pause or resume during the file playback. The pot R43 can
be used to control the volume of the speaker (and headphones if fitted). Visual indication of status, volume and
progress are shown on the display.
Caution:
Headphones should be connected to the 3.5mm line-out connector CN5. Connector CN6 is designed to
connect to a speaker only. It is not recommended to attach headphones to speaker connection CN6, as
damage to the headphones may occur. Refer to section 4.2.6 for further information.
6.1.2

PCM Data Transfer

The transfer of PCM data from the .wav file on the USB drive to the audio CODEC is managed by a receive
buffer for data pulled from the USB drive and a corresponding transmit buffer to send data to the CODEC via
the SSI interface. The Renesas TFAT FIT module is used to transfer data from the USB to the receive buffer.
Internally, data is transferred from receive buffer to transmit buffer by a memcpy function. The 16-bit PCM data
in the transmit buffer is sent to the CODEC via the SSI interface by the DMAC microcontroller peripheral,
matching the sampling frequency of the wav files at 48kHz.
In order to achieve seamless playback each buffer is divided into 3 sub-blocks. The data being transferred into
a buffer is always being placed into a different sub-block to the data being transferred out of the buffer to the
next stage. The changeover process for updating the active read/write blocks is managed in the DMAC0 end of
transfer interrupt, which is the slowest part of the chain from USB to CODEC. In this way, the CODEC has a
continuous supply of data.
Figure 6-1 shows this transfer graphically. Table 6-1 shows the operations in progress at each step.
USB
Step
USB operation
1
data read into rx buffer (c)
2
data read into rx buffer (a)
3
data read into rx buffer (b)
R12UZ0012EG0110 Rev. 1.10
Apr 03, 2017
Rx Buffer
(a)
2
3
(b)
1
(c)
Figure 6-1 : USB Playback Mode Buffer Processing Overview
Table 6-1 : USB Playback Mode Buffer Operations
memcpy
3
1
2
memcpy operation
rx buffer (b) to tx buffer (b)
rx buffer (c) to tx buffer (c)
rx buffer (a) to tx buffer (a)
6 Description of Software
DMAC0 (SSI)
Tx Buffer
(a)
1
2
(b)
3
(c)
DMAC0 operation
tx buffer (a) to CODEC
tx buffer (b) to CODEC
tx buffer (c) to CODEC
CODEC
Page 24 of 34

Advertisement

Table of Contents
loading

Table of Contents