23.04.2013 Views

TMPM330 - Keil

TMPM330 - Keil

TMPM330 - Keil

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Transmit Buffer<br />

Under development<br />

<strong>TMPM330</strong> (rev 0.4) 9-20<br />

<strong>TMPM330</strong><br />

The transmit buffer (SC0BUF) is in a dual structure. The double buffering function may be<br />

enabled or disabled by setting the double buffer control bit in serial mode control<br />

register 2 (SC0MOD2). If double buffering is enabled, data written to Transmit Buffer 2<br />

(SCOBUF) is moved to Transmit Buffer 1 (shift register).<br />

If the transmit FIFO has been disabled (SCOFCNF = 0 or 1 and SC0MOD1<<br />

FDPX1:0>=01), the INTTX0 interrupt is generated at the same time and the transmit<br />

buffer empty flag of SC0MOD2 is set to “1.” This flag indicates that Transmit<br />

Buffer 2 is now empty and that the next transmit data can be written. When the next data is<br />

written to Transmit Buffer 2, the flag is cleared to “0.”<br />

If the transmit FIFO has been enabled (SCNFCNF = 1 and SC0MOD1=10/11), any data in the transmit FIFO is moved to the Transmit Buffer 2 and <br />

flag is immediately cleared to “0.” The CPU writes data to Transmit Buffer 2 or to the<br />

transmit FIFO.<br />

If the transmit FIFO is disabled in the I/O interface SCLK input mode and if no data is set in<br />

Transmit Buffer 2 before the next frame clock input, which occurs upon completion of data<br />

transmission from Transmit Buffer 1, an under-run error occurs and a serial control register<br />

(SC0CR) parity/under-run flag is set.<br />

If the transmit FIFO is enabled in the I/O interface SCLK input mode, when data<br />

transmission from Transmit Buffer 1 is completed, the Transmit Buffer 2 data is moved to<br />

Transmit Buffer 1 and any data in transmit FIFO is moved to Transmit Buffer 2 at the same<br />

time.<br />

If the transmit FIFO is disabled in the I/O interface SCLK output mode, when data in<br />

Transmit Buffer 2 is moved to Transmit Buffer 1 and the data transmission is completed, the<br />

SCLK output stops. So, no under-run errors can be generated.<br />

If the transmit FIFO is enabled in the I/O interface SCLK output mode, the SCLK output<br />

stops upon completion of data transmission from Transmit Buffer 1 if there is no valid data<br />

in the transmit FIFO.<br />

Note) In the I/O interface SCLK output mode, the SC0CR flag is<br />

insignificant. In this case, the operation is undefined. Therefore, to switch<br />

from the SCLK output mode to another mode, SC0CR must be read in<br />

advance to initialize the flag.<br />

If double buffering is disabled, the CPU writes data only to Transmit Buffer 1 and the<br />

transmit interrupt INTTX0 is generated upon completion of data transmission.<br />

If handshaking with the other side is necessary, set the double buffer control bit to<br />

“0” (disable) to disable Transmit Buffer 2; any setting for the transmit FIFO should not be<br />

performed.<br />

Serial Channel (SIO)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!