23.04.2013 Views

TMPM330 - Keil

TMPM330 - Keil

TMPM330 - Keil

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SCL<br />

SDA<br />

<br />

INTSBIx interrupt<br />

request<br />

Under development<br />

<strong>TMPM330</strong> (rev 0.4) 10-22<br />

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

To terminate the data transmission from the transmitter, must be set to “0”<br />

immediately before reading the data word second to last. This disables generation of an<br />

acknowledgment clock for the last data word. When the transfer is completed, an interrupt<br />

request is generated. After the interrupt processing, must be set to “001” and the<br />

data must be read so that a clock is generated for 1-bit transfer. At this time, the master<br />

receiver holds the SDA bus line at the “H” level, which signals the end of transfer to the<br />

transmitter as an acknowledgment signal.<br />

In the interrupt processing for terminating the reception of 1-bit data, the stop condition is<br />

generated to terminate the data transfer.<br />

9<br />

1<br />

D7 D6 D5 D4 D3 D2 D1 D0<br />

Acknowledgment signal<br />

to transmitter “H”<br />

Fig. 10-17 Terminating Data Transmission in the Master Receiver Mode<br />

Example: When receiving N data word<br />

INTSBIx interrupt (after data transmission)<br />

SBIxCR1<br />

7 6 5 4 3 2 1 0<br />

← X X X X 0 X X X Sets the number of bits of data to be received and<br />

specify whether ACK is required.<br />

Reg. ← SBI0DBR Reads dummy data.<br />

End of interrupt<br />

INTSBIx interrupt (first to (N-2)th data reception)<br />

7 6 5 4 3 2 1 0<br />

Reg. ← SBIxDBR Reads the first to (N-2)th data words.<br />

End of interrupt<br />

INTSBIx interrupt ((N-1)th data reception)<br />

SBIxCR1<br />

7 6 5 4 3 2 1 0<br />

← X X X 0 0 X X X Disables generation of acknowledgement clock.<br />

Reg. ← SBIxDBR Reads the (N-1)th data word.<br />

End of interrupt<br />

INTSBIx interrupt (Nth data reception)<br />

7 6 5 4 3 2 1 0<br />

SBIxCR1 ← 0 0 1 0 0 X X X Disables generation of acknowledgement clock.<br />

Reg. ← SBIxDBR Reads the Nth data word.<br />

End of interrupt<br />

INTSBIx interrupt (after completing data reception)<br />

Processing to generate the stop condition. Terminates the data transmission.<br />

End of interrupt<br />

2 3 4 5 6 7 8 1<br />

Read out the received data after clearing to "0”.<br />

(Note) X: Don’t care<br />

Read out the received<br />

data after setting<br />

to "001."<br />

Master output<br />

Slave output<br />

Serial Bus Interface (SBI)

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

Saved successfully!

Ooh no, something went wrong!