beautypg.com

Address and data bytes – Rainbow Electronics DS1305 User Manual

Page 12

background image

DS1305

12 of 20

Figure 5. SERIAL CLOCK AS A FUNCTION OF MICROCONTROLLER CLOCK
POLARITY (CPOL)

1) CPHA bit polarity (if applicable) may need to be set accordingly.
2) CPOL is a bit that is set in the microcontroller’s control register.
3) SDO remains at high-Z until 8 bits of data are ready to be shifted out during a read.

ADDRESS AND DATA BYTES

Address and data bytes are shifted MSB first into the serial data input (SDI) and out of the serial data
output (SDO). Any transfer requires the address of the byte to specify a write or read to either a RTC or
RAM location, followed by one or more bytes of data. Data is transferred out of the SDO for a read
operation and into the SDI for a write operation (Figures 6 and 7).

Figure 6. SPI SINGLE-BYTE WRITE

Figure 7. SPI SINGLE-BYTE READ

*SCLK can be either polarity.

CE

CPOL = 1

SCLK

DATA LATCH (WRITE)

SHIFT DATA OUT (READ)

CPOL = 0

SCLK

DATA LATCH (WRITE)

SHIFT DATA OUT (READ)