Example Of Serial Sound Interface Operation - Renesas M16C Series User Manual

16-bit single-chip microcomputer
Hide thumbs Also See for M16C Series:
Table of Contents

Advertisement

M30245 Group

2.6.2 Example of Serial Sound Interface operation

When using Serial Sound Interface (SSI), the DMA is recommended for reading and writing data quickly
from the receive buffer to the transmit buffer. A programming example using DMA is shown below Figure
2.6.5 shows an example of Serial Sound Interface transmit timing, and Figure 2.6.6 shows an example of
Serial Sound Interface receive timing.
/***** Serial Sound Interface initialization routine *****************************************************
Serial Sound Interface is initialized by disabling.
www.DataSheet4U.com
The DMA to use is also initialized.
In this example, one DMA is used for each Serial Sound Interface input and output.
*************************************************************************************************************/
ssi1mr1 = 0x00;
ssi1mr0 = 0x00;
dm0sl = 0x00;
dm0con = 0x00;
dm1sl = 0x00;
dm1con = 0x00;
/***** Setting example **********************************************************************************
Audio transmission can be set before or after audio reception
The DMA to use is set.
DMA0 = audio data transmission and DMA1= audio data reception
*************************************************************************************************************/
dm0ic = 0x06;
dm0sl = 0x0e;
sar0 = (unsigned long)&txb_buffer;
dar0 = (unsigned long)&ssi1txb;
tcr0 = txb_counter;
dm1ic = 0x06;
dm1sl = 0x0a;
sar1 = (unsigned long)&ssi1rxb;
dar1 = (unsigned long)&rxb_buffer;
tcr1 = rxb_counter;
/***** Activation processing routine ********************************************************************
DMA activation. DMA0 can be activated before or after DMA1.
*************************************************************************************************************/
dm0con = 0x18;
dm1con = 0x28;
/*******Serial Sound Interface is stopped at this point.
Serial Sound Interface is enabled and audio data transmission/reception starts.***********/
Rev.2.00 Oct 16, 2006
REJ09B0340-0200
(Continued to the next page.)
page 116 of 354
/* SSI STOP */
/* SSI STOP */
/* DMA0 STOP */
/* DMA0 STOP */
/* DMA1 STOP */
/* DMA1 STOP */
/* DMA completion interrupt enabled */
/* DMA0 factor = SSI 1 transmit */
/* source address: buffer RAM, etc. */
/* destination address: SSI 1 transmit buffer */
/* DMA0 transfer cycle setting */
/* DMA completion interrupt enabled */
/* DMA1 factor = SSI 1 receive */
/* source address: SSI 1 receive */
/* destination address: buffer RAM, etc. */
/* DMA1 transfer cycle setting */
/* DMA0 start [16bit, SRC = inc, single] */
/* DMA1 start [16bit, DES = inc, single] */
2. Serial sound interface

Advertisement

Table of Contents
loading

Table of Contents