Khác biệt giữa các bản “Tiny RTC + EEPROM”

Từ ChipFC Wiki
Bước tới: chuyển hướng, tìm kiếm
(Tạo trang mới với nội dung “Category:Module 400px|thumb|alt=Tiny RTC + EEPROM|right|Tiny RTC + EEPROM == Introduction == This tiny RTC module is b…”)
 
(Programming)
 
(Không hiển thị 9 phiên bản của cùng người dùng ở giữa)
Dòng 1: Dòng 1:
 
[[Category:Module]]
 
[[Category:Module]]
[[Hình:Tiny_RTC_EEPROM.jpg|400px|thumb|alt=Tiny RTC + EEPROM|right|Tiny RTC + EEPROM]]
+
[[Hình:Tiny_RTC_EEPROM1.jpg|400px|thumb|alt=Tiny RTC + EEPROM|right|Tiny RTC + EEPROM]]
  
== Introduction  ==
+
= Thông tin chung =
 +
[https://chipfc.com/module-chuc-nang/thoi-gian-luu-tru/module-thoi-gian-thuc-rtc-ds1307.html Module Tiny RTC + EEPROM] trên trang chủ
 +
 
 +
== Giới thiệu ==
 
This tiny RTC module is based on the clock chip DS1307 which supports the I2C protocol. It uses a Lithium cell battery (CR1225). The 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 12-hour format with AM/PM indicator.<BR>
 
This tiny RTC module is based on the clock chip DS1307 which supports the I2C protocol. It uses a Lithium cell battery (CR1225). The 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 12-hour format with AM/PM indicator.<BR>
'''Model: [http://www.elecrow.com/tiny-rtc-for-arduino-p-323.html SMI00101S]'''
+
 
  
 
[[File:Tiny_RTC_EEPROM1.jpg|200px|400px]]
 
[[File:Tiny_RTC_EEPROM1.jpg|200px|400px]]
 
[[File:Tiny_RTC_EEPROM2.jpg|200px|400px]]
 
[[File:Tiny_RTC_EEPROM2.jpg|200px|400px]]
  
==Features==
+
==Đặc điểm==
 
*5V DC supply<BR>
 
*5V DC supply<BR>
 
*Programmable Square-Wave output signal<BR>
 
*Programmable Square-Wave output signal<BR>
Dòng 16: Dòng 19:
 
*56-Byte, Battery-Backed, Nonvolatile (NV)RAM for data storage<BR>
 
*56-Byte, Battery-Backed, Nonvolatile (NV)RAM for data storage<BR>
  
== Usage  ==
+
= Sử dụng =
  
=== Hardware===
+
== Hardware==
 
The RTC module use the I2C bus to communicate with Arduino&Crowduinom. Arduino has one I2C port with A4 and A5, connect the RTC module to Arduino as below:<BR>
 
The RTC module use the I2C bus to communicate with Arduino&Crowduinom. Arduino has one I2C port with A4 and A5, connect the RTC module to Arduino as below:<BR>
[[file:Tiny_RTC_EEPROM_hardware.jpg |500px]]    [[file:Tiny_RTC_EEPROM_hardware1.jpg |500px]]
+
[[file:Tiny_RTC_EEPROM_hardware.png|500px]]
  
=== Programming  ===
+
== Programming  ==
 
1.Download the library File:[http://www.elecrow.com/wiki/index.php?title=File:RTC.zip RTC Library]
 
1.Download the library File:[http://www.elecrow.com/wiki/index.php?title=File:RTC.zip RTC Library]
  
Dòng 28: Dòng 31:
  
 
3.Open the code directly by the path:File -> Example ->RTC.
 
3.Open the code directly by the path:File -> Example ->RTC.
{| style="border-radius: 6px 6px 6px 6px;border: 1px dotted"
+
<syntaxhighlight lang="cpp">
|<syntaxhighlight lang="cpp">
 
 
#include <Wire.h>
 
#include <Wire.h>
 
#include "RTClib.h"
 
#include "RTClib.h"
Dòng 61: Dòng 63:
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
|}
 
  
 
4.Upload the code,then open the serial monitor to see the current time.
 
4.Upload the code,then open the serial monitor to see the current time.
  
[[File:Tiny_RTC_EEPROM_result1.jpg |400px]]
+
[[File:Tiny_RTC_EEPROM_result1.jpg]]
  
 
== Resource  ==
 
== Resource  ==
  
*[http://www.elecrow.com/wiki/index.php?title=File:RTC.zip RTC Program]
+
*[https://www.elecrow.com/wiki/index.php?title=Tiny_RTC Tiny RTC ]
*Click [http://www.elecrow.com/sensor-c-111/misc-c-111_115/tiny-rtc-for-arduino-p-323.html Tiny RTC For Arduino] to buy.
+
*[http://arduino.vn/tutorial/1370-huong-dan-su-dung-ic-eeprom-24cxx-cua-atmel-va-thu-vien Hướng dẫn sử dụng ic eeprom 24Cxx của Atmel]

Bản hiện tại lúc 11:47, ngày 2 tháng 3 năm 2018

Tiny RTC + EEPROM
Tiny RTC + EEPROM

Thông tin chung

Module Tiny RTC + EEPROM trên trang chủ

Giới thiệu

This tiny RTC module is based on the clock chip DS1307 which supports the I2C protocol. It uses a Lithium cell battery (CR1225). The 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 12-hour format with AM/PM indicator.


Tiny RTC EEPROM1.jpg Tiny RTC EEPROM2.jpg

Đặc điểm

  • 5V DC supply
  • Programmable Square-Wave output signal
  • Automatic Power-Fail detect and switch circuitry
  • Consumes less than 500nA in Battery-Backup Mode with Oscillator Running
  • 56-Byte, Battery-Backed, Nonvolatile (NV)RAM for data storage

Sử dụng

Hardware

The RTC module use the I2C bus to communicate with Arduino&Crowduinom. Arduino has one I2C port with A4 and A5, connect the RTC module to Arduino as below:
Tiny RTC EEPROM hardware.png

Programming

1.Download the library File:RTC Library

2.Unzip it into the libraries file of Arduino IDE by the path: ..\arduino-1.0\libraries.

3.Open the code directly by the path:File -> Example ->RTC.

#include <Wire.h>
#include "RTClib.h"
RTC_DS1307 RTC;

void setup () {
    Serial.begin(9600);
    Wire.begin();
    RTC.begin();
  if (! RTC.isrunning()) {
    Serial.println("RTC is NOT running!");
    // following line sets the RTC to the date & time this sketch was compiled
    RTC.adjust(DateTime(__DATE__, __TIME__));
  }
}
void loop () {
    DateTime now = RTC.now(); 
    Serial.print(now.year(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.day(), DEC);
    Serial.print(' ');
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println(); 
    delay(1000);
}

4.Upload the code,then open the serial monitor to see the current time.

Tiny RTC EEPROM result1.jpg

Resource