Details
BUY DS1218S+ https://www.utsource.net/itm/p/12408884.html
Parameter | Description |
---|---|
Device Type | Real-Time Clock (RTC) with SRAM and Battery Backup |
Package | 16-SOIC (Small Outline Integrated Circuit) |
Operating Voltage | VCC: 2.2V to 5.5V; VBAT: 1.8V to 3.6V |
Operating Temperature | -40°C to +85°C |
Clock Accuracy | ±2 minutes per year at 25°C |
SRAM Size | 1024 bytes (1K x 8) |
Battery Backup | Lithium coin cell battery (CR1220 or similar) |
Communication Interface | I2C (Two-wire Serial Interface) |
I2C Address | 0x68 (Fixed) |
Oscillator Frequency | 32.768 kHz |
Power Consumption | < 1 μA in battery backup mode |
Write Protection | Hardware write protect pin (WP) |
Supply Current | 100 μA typical (active mode) |
Quartz Crystal | External 32.768 kHz crystal required |
Instructions for Use
Power Supply Connection
- Connect VCC to the main power supply (2.2V to 5.5V).
- Connect VBAT to a backup battery (1.8V to 3.6V).
Ground Connection
- Ensure a common ground (GND) is connected to both VCC and VBAT.
I2C Interface
- Connect SDA (Data) and SCL (Clock) lines to the I2C bus.
- Use pull-up resistors on SDA and SCL lines (typically 4.7kΩ to VCC).
Write Protection
- Set the WP (Write Protect) pin to GND to enable writing to the SRAM.
- Set the WP pin to VCC to disable writing to the SRAM.
External Crystal
- Connect a 32.768 kHz quartz crystal between X1 and X2 pins for accurate timekeeping.
Initialization
- Initialize the RTC using the I2C interface to set the current date and time.
- Use the appropriate I2C commands to read and write data from/to the SRAM.
Reading Time and Date
- Use the I2C interface to read the time and date registers.
- The time and date are stored in BCD (Binary-Coded Decimal) format.
Writing Time and Date
- Convert the desired time and date to BCD format.
- Write the values to the appropriate registers using the I2C interface.
Battery Backup
- Ensure the backup battery is installed correctly to maintain the clock and SRAM data during power loss.
Testing
- After setup, verify the operation by reading the time and date to ensure they are updating correctly.
For detailed register maps and specific I2C commands, refer to the DS1218S+ datasheet provided by the manufacturer.
(For reference only)View more about DS1218S+ on main site