27.12.2012 Views

Atmel AT89C51ID2 Data Sheet - Keil

Atmel AT89C51ID2 Data Sheet - Keil

Atmel AT89C51ID2 Data Sheet - 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.

Figure 40. <strong>Data</strong> Transmission Format (CPHA = 0)<br />

4289A–8051–09/03<br />

SCK cycle number<br />

SPEN (internal)<br />

SCK (CPOL = 0)<br />

SCK (CPOL = 1)<br />

MOSI (from Master)<br />

MISO (from Slave)<br />

SS (to Slave)<br />

Capture point<br />

Figure 41. <strong>Data</strong> Transmission Format (CPHA = 1)<br />

SCK cycle number<br />

SPEN (internal)<br />

SCK (CPOL = 0)<br />

SCK (CPOL = 1)<br />

MOSI (from Master)<br />

MISO (from Slave)<br />

SS (to Slave)<br />

Capture point<br />

Figure 42. CPHA/SS Timing<br />

MISO/MOSI<br />

Master SS<br />

Slave SS<br />

(CPHA = 0)<br />

Slave SS<br />

(CPHA = 1)<br />

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

MSB bit6 bit5 bit4 bit3 bit2 bit1 LSB<br />

MSB bit6 bit5 bit4 bit3 bit2 bit1 LSB<br />

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

MSB bit6 bit5 bit4 bit3 bit2 bit1 LSB<br />

MSB bit6 bit5 bit4 bit3 bit2 bit1 LSB<br />

Byte 1 Byte 2 Byte 3<br />

<strong>AT89C51ID2</strong><br />

As shown in Figure 40, the first SCK edge is the MSB capture strobe. Therefore the<br />

Slave must begin driving its data before the first SCK edge, and a falling edge on the SS<br />

pin is used to start the transmission. The SS pin must be toggled high and then low<br />

between each byte transmitted (Figure 42).<br />

Figure 41 shows an SPI transmission in which CPHA is’1’. In this case, the Master<br />

begins driving its MOSI pin on the first SCK edge. Therefore the Slave uses the first<br />

SCK edge as a start transmission signal. The SS pin can remain low between transmissions<br />

(Figure 42). This format may be preffered in systems having only one Master and<br />

only one Slave driving the MISO data line.<br />

103

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

Saved successfully!

Ooh no, something went wrong!