Se rendre au contenu

ALLNET 4duino RTC Echtzeit-Uhr Modul DS1302

https://www.allnetfrance.fr/web/image/product.template/69682/image_1920?unique=1f0a4fe
ALLNET 4duino RTC Echtzeit-Uhr Modul DS1302

0,00 € 0.0 EUR 0,00 € Hors taxes

1,73 € Hors taxes

Connectez-vous pour voir les prix

  • Marque

Cette combinaison n'existe pas.

Marque: ALLNET

Conditions générales
Contactez-nous pour nous demander plus d'informations sur ce produit.


EAN: 4038816135940
Référence interne: AllRTCDS1302

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 fewer than 31 days, including corrections for leap year. The clock operates in either the 24-hour or&nbsp
12-hour format with an AM/PM indicator. Interfacing the DS1302 with a microprocessor is simplified by using synchronous serial communication. Only three&nbsp
wires are required to communicate with the clock/RAM: CE, I/O (data line), and SCLK (serial clock). Data can be transferred to and from the clock/RAM 1 byte at a time or in a burst of up to 31 bytes. The DS1302 is designed to operate on very low power and retain data and clock information on less than 1µW. The DS1302 is the successor to the DS1202. In addition to the basic timekeeping functions of the DS1202, the DS1302 has the additional features of dual power pins for primary and backup power supplies, programmable trickle charger for VCC1, and seven additional bytes of scratchpad memory.&nbsp

FEATURES&nbsp

    ?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&nbsp
    ?31 x 8 Battery-Backed General-Purpose RAM&nbsp
    ?Serial I/O for Minimum Pin Count&nbsp
    2.0V to 5.5V Full Operation&nbsp
    Uses Less than 300nA at 2.0V&nbsp
    Single-Byte or Multiple-Byte (Burst Mode)&nbsp
    Data Transfer for Read or Write of Clock or RAM Data&nbsp
    ?Simple 3-Wire Interface&nbsp
    TTL-Compatible (VCC = 5V)&nbsp
    Optional Industrial Temperature Range: -40°C to +85°C&nbsp
    ?DS1202 Compatible



4duino Example Sketch:

Code:
/* FILE:&nbsp &nbsp ARD_1302_RTC_Example_Sketch_HCMODU0035
&nbsp &nbspDATE:&nbsp &nbsp 03/09/13
&nbsp &nbspVERSION: 0.1
&nbsp &nbsp
REVISIONS:

20/09/13 Created version 0.1

This is an example of how to use the Hobby Components 1302 Real Time Clock
module (HCMODU0035). This example uses the RTC library written by Henning Karlsen&nbsp
(http://www.henningkarlsen.com/electronics/). This example sketch demonstrates&nbsp
how to read and write to the RTC module. To connect the module to your Arduino&nbsp
please see the following pinout:

PINOUT:

MODULE&nbsp &nbsp ARDUINO
GND&nbsp &nbsp &nbsp &nbspGND&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp
VCC&nbsp &nbsp &nbsp &nbsp+5V&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp&nbsp
SCK&nbsp &nbsp &nbsp &nbspD4
I/O&nbsp &nbsp &nbsp &nbspD3
RST(CS)&nbsp &nbspD2


You may copy, alter and reuse this code in any way you like, but please leave
reference to HobbyComponents.com in your comments if you redistribute this code.
This software may not be used for the purpose of premoting or selling products&nbsp
that directly compete with Hobby Components Ltds own range of products.

THIS SOFTWARE IS PROVIDED AS IS. HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
REASON WHATSOEVER. */

/* Define the DIO pins used for the RTC module */
#define SCK_PIN 4
#define IO_PIN 3
#define RST_PIN 2

/* Include the DS1302 library */
#include &ltDS1302.h&gt

/* Initialise the DS1302 library */
DS1302 rtc(RST_PIN, IO_PIN, SCK_PIN)

void setup()
{
&nbsp /* Clear the 1302s halt flag */
&nbsp rtc.halt(false)
&nbsp /* And disable write protection */
&nbsp rtc.writeProtect(false)
&nbsp
&nbsp /* Initialise the serial port */
&nbsp Serial.begin(9600)
}

/* Main program */
void loop()
{
&nbsp&nbsp
&nbsp /* Set the time and date to 16:30 on the 3rd of September 2013 */
&nbsp rtc.setDOW(MONDAY)
&nbsp rtc.setTime(16,30,0)
&nbsp rtc.setDate(3, 9, 2013)&nbsp
&nbsp&nbsp
&nbsp /* Read the time and date once every second */
&nbsp while(1)
&nbsp {
&nbsp &nbsp Serial.print(It is )
&nbsp &nbsp Serial.print(rtc.getDOWStr())
&nbsp &nbsp Serial.print( )
&nbsp &nbsp Serial.print(rtc.getDateStr())
&nbsp &nbsp Serial.print( )
&nbsp &nbsp Serial.print(and the time is: )
&nbsp &nbsp Serial.println(rtc.getTimeStr())

&nbsp &nbsp /* Wait before reading again */
&nbsp &nbsp delay (1000)
&nbsp }
}