DS1302 ARTSCHIP | Alldatasheet

Document overview

  • Manufacturer or author: Provided By ALLDATASHEET.COM(FREE DATASHEET DOWNLOAD SITE)
  • PDF pages: 13

Technical content

Trickle Charge Timekeeping Chip www.artschip.com 1

FEATURES

z Real time clock counts seconds, minutes hours, date of the month, month, day of the week, and year with leap year compensation valid up to 2100 z 31 x 8 RAM for scratchpad data storage z Serial I/O for minimum pin count z 2.0-5.5V full operation z Uses less than 300nA at 2.0V z Single –byte or multiple-byte (burst mode) data transfer for read or write of clock or RAM data z 8-pin DIP or optional 8-pin SOICs for surface mount z Simple 3-wire interface z TTL-compatible (Vcc=5V) z Optional industrial temperature range -40¥ to +85 ¥ z DS1202 compatible z Recognized by Underwriters Laboratory

ORDERING INFORMATION

P A R T # D E S C R I P T I O N D S 1 3 0 2 8 - P i n D I P DS1302N 8-Pin DIP (Industrial) DS1302S 8-Pin SOIC (200 mil) DS1302SN 8-Pin SOIC (Industrial) D S 1 3 0 2 Z 8 - P i n S O I C ( 1 5 0 m i l ) DS1302ZN 8-Pin SOIC (Industrial) DS1302S-16 16-Pin SOIC (300 mil) DS1302SN-16 16-Pin SOIC (Industrial) PIN ASSIGNMENT DS1302 8-Pin DIP (300 mil) DS1302S 8-Pin SOIC (200 mil) DS1302Z 8-Pin SOIC (150 mil) 16-Pin SOIC PIN DESCRIPTION X 1 , X 2 - 3 2 . 7 6 8 k H z C r y s t a l P i n s GND -Ground - R e s e t I/O -Data Input/Output S C L K - S e r i a l C l o c k VCC1, VCC2 - P o w e r S u p p l y P i n s

DESCRIPTION

The DS1302 Trickle Charge Timekeeping Chip contains a real time clock/calendar and 31 bytes of static RAM. It communicates with a microprocessor via a simple serial interface. The real time clock/calendar provides seconds, minutes, hours, day, date, month, and year information. The end of the month date is automatically adjusted for months with less than 31 days, including corrections for leap year. The clock operates in either the 24-hour or 12-hour format with an AM/PM indicator.

Trickle Charge Timekeeping Chip www.artschip.com 2 Interfacing the DS1302 with a microprocessor is simplified by us ing synchronous serial communication. Only three wires are required to communicate with the clock/RAM: (1) (Reset), (2) I/O (Data line), and (3) SCLK (Serial Clock). Data can be transferred to and from the clock/RAM 1 byte at a time or in a burst of up 31 bytes. The DS13 02 is designed to operate on very low power and retain data and clock information on less than 1 microwatt. The DS1302 is the successor to the DS1202. In addition to the bas ic timekeeping functions of the DS1202, the DS1302 has the additional features of dual power pins for primary and back-up power supplies, programmable trickle charger for VCC1, and seven additional bytes of scratchpad memory. OPERATION The main elements of the Serial Timekeeper are shown in Figure 1: shift register, control logic, oscillator, real time clock, a nd RAM. DS1302 BLOCK DIAGRAM Figure 1 SIGNAL DESCRIPTIONS Vcc1-Vcc1 provides low power operation in single supply and battery operated systems as well as low power battery backup. In systems using the trickle charger, the rechargeable energy source is connected to this pin. Vcc2-Vcc2 is the primary power supply pin in a dual supply configur ation. Vcc1 is connected to a backup source to maintain the time and date in the absence of primary power. The DS1302 will operate from the larger of Vcc1 or Vcc2. When Vcc2 is greater than Vcc1+0.2V, Vcc2 will power the DS1302. When Vcc2 is less than Vcc1, Vcc1 will power the DS1302. SCLK (Serial Clock Input) – SCLK is used to synchronize data movement on the serial interface. I/O (Data Input/Output) –The I/O pin is the bi-directional data pin for the 3-wire interface. (Reset) –The reset signal must be asserted high during a read or a write.

Trickle Charge Timekeeping Chip www.artschip.com 3 X1, X2 –Connections for a standard 32.768 kHz quartz crystal. The inte rnal oscillator is designed for operation with a crystal having a specified load capacitance of 6 pF. For more information on crystal selection and crystal layout considerations, pleas e consult Application Note 58, “Crystal Considerations with ARTSCHIP Real Time Clocks.” The DS1302 can also be driven by an external 32.768 kHz oscillator. In this c onfiguration, the x1 pin is connected to the external oscillator signal and the X2 pin is floated. COMMAND BYTE The command byte is shown is Figure 2. Each data transfer is initiated by a command byte. The MSB (Bit 7) must be a logic 1. If it is 0, writes to the DS1302 will be disabled. Bit 6 specifies clock/calendar data if logic 0 or RAM data if logic 1. Bits 1 thro ugh 5 specify the designated registers to be input or output, and the L SB (bit 0) specifies a write oper ation (input) if logic 0 or r ead operation (output) if logic 1. The command byte is always input starting with the LSB (bit 0). ADDRESS/COMMAND BYTE Figure 2 RESET AND CLOCK CONTROL All data transfers are initiated by driving the input high. The input serves two functions. First, turns on the control logic which allows access to the shift register for the address/command sequence. Second, the signal provides a method of terminating either single byte or multiple byte data transfer. A clock cycle is a sequence of a falling edge followed by a rising edge. For data inputs, data must be valid during the rising edge of the clock and data bits are output on the falling edge of clock. If the input is low all data transfer terminates and the I/O pin goes to a high impedance state. Data transfer is illustrated in Figur e 3. At power-up, must be a logic 0 until Vcc >2.0 volts. Also SCLK must be at a logic 0 when is driven to a logic 1 state. DATA INPUT Following the eight SCLK cycles that input a write command byte, a data byte is input on the rising edge of the next eight SCLK cycles. Additional SCLK cycles are ignored should they inadvertently occur. Data is input starting with bit 0. DATA OUTPUT Following the eight SCLK cycles that input a read command byte, a data byte is output on the falling edge of the next eight SCLK cycles. Note that the first data bit to be transmitted occurs on the first falling edge after the last bit of the command byte is written. Additional SCLK cycles retransmit the data bytes should they inadvertently occur so long as remains high. This operation permits continuous burst mode read capability. Also, the I/O pin is tri-stated upon each rising edge of SCLK. Data is output starting with bit 0. BURST MODE Burst mode may be specified for either the clock/calendar or the RAM registers by addressing location 31 decimal (address/command bits 1 through 5 = logic 1). As before, bit 6 specifies clock or RAM and bit 0 specifies read or write. There is no data storage capacity at locations 9 through 31 in the Clock/Cale ndar Registers or location 31 in the RAM registers. Reads or writes in burst mode start with bit 0 of address 0. When writing to the clock registers in the burst mode, the first eight registers must be written in order for the data to be transferred. However, when writing to RAM in burst mode it is not necessary to write all 31 bytes for the data to transfer. Each byte that i s written to will be transferred to RAM regardless or whether all 31 bytes are written or not.

Trickle Charge Timekeeping Chip www.artschip.com 4 CLOCK/CALENDAR The clock/calendar is contained in seven write/read registers as shown in Figure 4. Data contained in the clock/calendar registers is in binary coded decimal format (BCD). CLOCK HALT FLAG Bit 7 of the seconds register is defined as the clock halt flag. When this bit is set to logic 1, the clock oscillator is stopped and the DS1302 is placed into a low-power standby mode with a current drain of less than 100 nanoamps. When this bit is written to logic 0, the clock will start. The initial power on state is not defined. AM-PM/12-14 MODE Bit 7 of the hours register is defined as the 12- or 24-hour mode select bit. When hi gh, the 12-hour mode is selected. In the 12-hour mode, bit 5 is the AM/PM bit with logic high being PM. In the 24-hour mode, bit 5 is the second 10-hour bit (20-23 hours). WRITE PROTECT BIT Bit 7 of the control register is the write-protect bit. The first seven bits (bits 0-6) are forced to 0 and will always read a 0 when read. Before any write operation to the clock or RAM, bit 7 must be 0. when high, the write protect bit prevents a write operation to any other register. The initial power on state is not defined, therefore the WP bit should be cleared before attempting to write to the device. TRICKLE CHARGE REGISTER This register controls the tr ickle charge characteristics of the DS1302. The simplified schematic of Figure 5 shows the basic components of the trickle charger. The trickle charge select (TCS) bits (bits 4-7) control the selection of the trickle charger. In order to prevent accidental enabling, only a pattern of 1010 will enable the trickle charger. All other patterns will disable the tri ckle charger. The DS1302 powers up with the trickle charger disabled. The diode select (DS) bits (bits 2-3) select whether one diode or two diodes are connected between Vcc2 and Vcc1. If DS is 01, one diode is selected or if DS is 10, two diodes are selected. If DS is 00 or 11, the trickle charger is disabled independently of TCS. The RS bits (bits 0-1) select the resistor that is connected between Vcc2 and Vcc1. The resistor selected by the resistor select (RS) bit is as follows. RS Bits Resistor Typical Value

00 None None

01 R1 2K Ω

10 R2 4K Ω

11 R3 8K Ω

If RS is 00, the trickle charger is disabled independently of TCS. Diode and resistor selection is determined by the user according to the maximum current desired for battery or super cap charging. The maximum charging current can be calculated as illustrated in the following example. Assume that a system power supply of 5 volt is applied to Vcc2 and a super cap is connected to Vcc1. Also assume that the trickle charger has been enabled with one diode and resistor R1 between Vcc2 and Vcc1. The maximum current Imax would therefore be calculated as follows: Imax =(5.0V – diode drop)/R1 ~ ( 5 . 0 V - 0 . 7 V ) / 2 KΩ ~ 2 . 2 m A Obviously, as the super cap charges, the voltage drop between Vcc2 and Vcc1 will decrease and therefore the charge current will decrease.

Trickle Charge Timekeeping Chip www.artschip.com 5 CLOCK/CALENDAR BURST MODE The clock/calendar command byte specifies burst mode operation. In this mode the fi rst eight clock/calendar registers can be consecutively read or written (see Figure 4) starting with bit 0 of address 0. If the write protect bit is set high when a write clock/calendar burst mode is specified, no data transfer will occur to any of the eight clock/calendar registers (this includes the control register). The trickle charger is not accessible in burst mode. At the beginning of a clock burst read, the current time is transferred to a second set of registers. The time information is read from these secondary registers, while the clock may continue to run. This eliminates the need to re-read the registers in case of an update of the main registers during a read. RAM The static RAM is 31 x 8 bytes addressed consecutively in the RAM address space. RAM BURST MODE The RAM command byte specifies burst mode operation. In this mode, the 31 RAM registers can be consecutively read or written (see Figure 4) starting with bit 0 of address 0. REGISTER SUMMARY A register data format summary is shown in Figure 4. CRYSTAL SELECTION A 32.768 kHz crystal can be directly connected to the DS1302 via X1 and X2. The crystal selected for use should have a specified load capacitance (CL) of 6 pF. For more information on crystal selection and crystal layout c onsideration, please consult Application Note 58, “Crystal Considerations with ARTSCHIP Real Time Clocks.” DATA TRANSFER SUMMARY Figure 3 SINGLE BYTE READ SINGLE BYTE WRITE In burst mode, is kept high and additional SCLK cy cles are sent until the end of the burst.

Trickle Charge Timekeeping Chip www.artschip.com 6 REGISTER ADDRESS/DEFINITION Figure 4

Trickle Charge Timekeeping Chip www.artschip.com 7 DS1302 PROGRAMMABLE TRICKLE CHARGER Figure 5 ABSOLUTE MAXIMUM RATINGS* Voltage on Any Pin Relative to Ground -0.5V to +7.0V O p e r a t i n g T e m p e r a t u r e 0¥ to 70 ¥ or -40 ¥ to +85 ¥ for industrial Storage Temperature -55 ¥ to +125 ¥ S o l d e r i n g T e m p e r a t u r e 2 6 0¥ for 10 seconds (DIP) See IPC/JEDEC Standard J-STD-020A for S u r f a c e M o u n t D e v i c e s *This is a stress rating only and functional operation of the device at t hese or any other conditions above those indicated in the operation sections of this specif ication is not implied. Exposure to absolute maximum rating conditions for extended periods of time may affect reliability. RECOMMENDED DC OPERATING CONDITIONS ( 0 ¥ to 70 ¥ or -40 ¥ to +85 ¥) PARAMETER SYMBOL MIN TYP MAX UNITS NOTES Supply Voltage VCC1, VCC2 V CC1, VCC2 2.0 5.5 V 1,11 Logic 1 Input VIH 2.0 Vcc+0.3 V 1 Vcc=2.0V -0.3 +0.3 Logic 0 Input VIL Vcc=5V -0.3 +0.3 V 1 * -40¥ to +85 ¥ for industrial device.

Trickle Charge Timekeeping Chip www.artschip.com 8 DC ELECTRICAL CHARACTERISTICS PARAMETER SYMBOL MIN TYP MAX UNITS NOTES Input Leakage IL1 +500 µA 6 I/O Leakage IL0 +500 µA 6 Logic 1 Output V OH VCC=2.0V VCC=5V 1.6 2.4 v 2 Logic 0 Output V OL VCC=2.0V VCC=5V 0.4 0.4 v 3 Active Supply Current I CC1A VCC1=2.0V VCC1=5V 0.4 1.2 mA 5,12 Timekeeping Current I CC1T VCC1=2.0V VCC1=5V 0.3 µA 4,12 Standby Current I CC1S VCC1=2.0V VCC1=5V 100 100 nA 10,12,14 Active Supply Current I CC2A IND VCC2=2.0V VCC2=5V 200 0.425 1.28 mA 5,13 Timekeeping Current I CC2T VCC2=2.0V VCC2=5V 25.3 µA 4,13 Standby Current I CC2S VCC2=2.0V VCC2=5V µA 10,13 Trickle charge Resistors kΩ kΩ kΩ Trickle Charge Diode Voltage Drop V TD 0.7 V CAPACITANCE ( t A=25¥) PARAMETER SYMBOL MIN TYP MAX UNITS NOTES Input Capacitance CI 10 pF I/O Capacitance CI/O 15 pF Crystal Capacitance CX 6 pF

Trickle Charge Timekeeping Chip www.artschip.com 9 AC ELECTRICAL CHARACTERISTICS PARAMETER SYMBOL MIN TYP MAX UNITS NOTES Vcc=2.0V 200 Data to CLK Setup t DC Vcc=5V 50 ns 7 Vcc=2.0V 280 CLK to Data Hold t CDH Vcc=5V 70 ns 7 Vcc=2.0V 800 CLK to Data Delay t CDD Vcc=5V 200 ns 7,8,9 Vcc=2.0V 1000 CLK Low Time t CL Vcc=5V 250 ns 7 Vcc=2.0V 1000 CLK High Time t CH Vcc=5V 250 ns 7 Vcc=2.0V 0.5 CLK Frequency t CLK Vcc=5V DC 2.0 MHz 7 Vcc=2.0V 2000 CLK Rise and Fall t R,tF Vcc=5V 500 ns 7 Vcc=2.0V 4 to CLK Setup tCC Vcc=5V 1 µs 7 Vcc=2.0V 240 CLK to Hold tCCH Vcc=5V 60 ns 7 Vcc=2.0V 4 Inactive Time tCWH Vcc=5V 1 µs 7 Vcc=2.0V 280 to I/O High Z tCDZ Vcc=5V 70 ns 7 Vcc=2.0V 280 SCLK to I/O High Z t CCZ Vcc=5V 70 ns 7 *Unless otherwise noted.

Trickle Charge Timekeeping Chip www.artschip.com 10 TIMING DIAGRAM: READ DATA TRANSFER Figure 5 TIMING DIAGRAM: WRITE DATA TRANSFER Figure 6 NOTES: 1. All voltage are referenced to ground. 2. Logic one voltages are specified at a source current of 1 mA at Vcc=5V and 0.4mA at Vcc=2.0V, V OH =Vcc for capacitive loads. 3. Logic zero voltages are specified at a sink cu rrent of 4 mA at Vcc=5V and 1.5mA at Vcc=2.0V, VOL=GND for capacitive loads. 4. I CC1T and LCC2T are specified with I/O open, set to a logic o 0p , and clock halt flag=0 (oscillator enabled). 5. ICC1A and ICC2A are specified with the I/O pin open, high, SCLK=2 MHz at Vcc=5V; SCLK=500KHz, Vcc=2.0V and clock halt flag=0 (oscillator enabled). 6. , SCLK, and I/O all have 40kΩ pull-down resistors to ground. 7. Measured at V IH = 2.0V or VIL =0.8V and 10 ns maximum rise and fall time. 8. Measured at V OH=2.4V or VOL=0.4V. 9. Load capacitance=50pF. 10. I CC1S and ICC2S are specified with , I/O, and SCLK open. The clock halt flag must be set to logic one (oscillator disabled). 11. Vcc=Vcc2. when Vcc2>Vcc1 +0.2V; Vcc=Vcc1, when Vcc1>Vcc2. 12. Vcc1=0V. 13. Vcc1=0V. 14. Typical values are at 25 ¥.

Trickle Charge Timekeeping Chip www.artschip.com 11 DS1302 SERIAL TIMEKEEPER 8-PIN DIP (300-MIL) PKG 8-PIN DIM MIN MAX A IN. MM 0.360 9.14 0.400 10.16 B IN. MM 0.240 6.10 0.260 6.60 C IN. MM 0.120 3.05 0.140 3.56 D IN. MM 0.300 7.62 0.325 8.26 E IN. MM 0.015 0.38 0.040 1.02 F IN. MM 0.120 3.04 0.140 3.56 G IN. MM 0.090 2.29 0.110 2.79 H IN. MM 0.320 8.13 0.370 9.40 J IN. MM 0.008 0.20 0.012 0.30 K IN. MM 0.015 0.38 0.021 0.53

Trickle Charge Timekeeping Chip www.artschip.com 12 DS1302S SERIAL TIMEKEEPER 8-PIN SOIC (150-MIL AND 200-MIL) PKG 8-PIN (150 MIL) 8-PIN (200 MIL) DIM MIN MAX MIN MAX A IN. MM 0.188 4.78 0.196 4.98 0.203 5.16 0.213 5.41 B IN. MM 0.150 3.81 0.158 4.01 0.203 5.16 0.213 5.41 C IN. MM 0.048 1.22 0.062 1.57 0.070 1.78 0.074 1.88 E IN. MM 0.004 0.10 0.010 0.25 0.004 0.10 0.010 0.25 F IN. MM 0.053 1.35 0.069 1.75 0.074 1.88 0.084 2.13 G IN. MM

0.050 BSC

1.27 BSC

H IN. MM 0.230 5.84 0.244 6.20 0.302 7.67 0.318 8.08 J IN. MM 0.007 0.18 0.011 0.28 0.006 0.15 0.010 0.25 K IN. MM 0.012 0.30 0.020 0.51 0.013 0.33 0.020 0.51 L IN. MM 0.016 0.41 0.050 1.27 0.019 0.48 0.030 0.76 phi 0˚ 8 ˚ 0 ˚ 8 ˚

Trickle Charge Timekeeping Chip www.artschip.com 13 DS1302S SERIAL TIMEKEEPER 16-PIN SOIC