This page is outdated since the DS1302 is replaced by the DS1307 that has it`s own pagina.
Description
This brick is an complete clock, providing a date and time with a resolution of 1 second with leap-year compensation valid up to 2100. The DS1302 is designed to operate on very low power and retain data and clock information on less than 1µW. It uses Less Than 300nA at 2.0V. The DS1302 is the successor to the DS1202. A 3Vdc battery cell (CR2032) keeps it running while powered off. Interfacing the DS1302 with a microprocessor is simplified by using synchronous serial communication. Communication is done through I²C and the address is fixed at #D0.
Connections
Only three wires are required to communicate with the clock/RAM: CE, I/O (data line), and SCLK (serial clock). On the Arduino these lines can be connected to any I/O pin directly, without any resistors needed.
Connections | Brick | Library |
CE | RST | kCePin |
I/O | DAT | kIoPin |
SCLK | CLK | kSclkPin |
Libraries
There are several libraries available to function with the DS1302:
- by NeiroN
This library is the only one included in the IDE that still uses the 1302 (2018). You must install his library locally by using the IDE Include library function. It also needs the #include Wire.h library. For some reason it just does not work for a DS1302 at my UNO rev3. Deze library werkt echter wel goed voor de nieuwere DS1307.
- by Matt Sparks
This library can be downloaded from Github.
Algemene informatie over dit onderdeelAlgemene informatie test |
---|
KYcode  | RO-041 | Prijs indicatie   | €  3,20 | Sketch voorbeeld   | Arduino | Menu groep   | Sensors | Laatste verandering   | 2019-04-20 |
Warning: include(/var/www/html/robotigs/includes/wishlistperpart.php): Failed to open stream: No such file or directory in /var/www/html/robotigs/includes/parts_header.php on line 128
Warning: include(): Failed opening '/var/www/html/robotigs/includes/wishlistperpart.php' for inclusion (include_path='.:/usr/share/php') in /var/www/html/robotigs/includes/parts_header.php on line 128
|  Afb 1: DS1302 clock brick |