
Rev.2.00 Oct 16, 2006
page 116 of 354
REJ09B0340-0200
M30245 Group
2. Serial sound interface
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.
The DMA to use is also initialized.
In this example, one DMA is used for each Serial Sound Interface input and output.
*************************************************************************************************************/
ssi1mr1 = 0x00;
/* SSI STOP */
ssi1mr0 = 0x00;
/* SSI STOP */
dm0sl = 0x00;
/* DMA0 STOP */
dm0con = 0x00;
/* DMA0 STOP */
dm1sl = 0x00;
/* DMA1 STOP */
dm1con = 0x00;
/* DMA1 STOP */
/***** 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;
/* DMA completion interrupt enabled */
dm0sl = 0x0e;
/* DMA0 factor = SSI 1 transmit */
sar0 = (unsigned long)&txb_buffer;
/* source address: buffer RAM, etc. */
dar0 = (unsigned long)&ssi1txb;
/* destination address: SSI 1 transmit buffer */
tcr0 = txb_counter;
/* DMA0 transfer cycle setting */
dm1ic = 0x06;
/* DMA completion interrupt enabled */
dm1sl = 0x0a;
/* DMA1 factor = SSI 1 receive */
sar1 = (unsigned long)&ssi1rxb;
/* source address: SSI 1 receive */
dar1 = (unsigned long)&rxb_buffer;
/* destination address: buffer RAM, etc. */
tcr1 = rxb_counter;
/* DMA1 transfer cycle setting */
/***** Activation processing routine ********************************************************************
DMA activation. DMA0 can be activated before or after DMA1.
*************************************************************************************************************/
dm0con = 0x18;
/* DMA0 start [16bit, SRC = inc, single] */
dm1con = 0x28;
/* DMA1 start [16bit, DES = inc, single] */
/*******Serial Sound Interface is stopped at this point.
Serial Sound Interface is enabled and audio data transmission/reception starts.***********/
(Continued to the next page.)