ADF-RTC-DS1307

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

Qu'est ce qu'un RTC

A real time clock is basically just like a watch - it runs on a battery and keeps time for you even when there is a power outage! Using an RTC, you can keep track of long timelines, even if you reprogram your microcontroller or disconnect it from USB or a power plug.

Most microcontrollers, including the Arduino have a built-in timekeeper called millis() and theres also timers built into the chip that can keep track of longer time periods like minutes or days. So why would you want to have a seperate RTC chip? Well, the biggest reason is that millis() only keeps track of time since the Arduino was last powered - that means that when the power is turned on, the millisecond timer is set back to 0. The Arduino doesnt know its 'Tuesday' or 'March 8th' all it can tell is 'Its been 14,000 milliseconds since I was last turned on'.

OK so what if you wanted to set the time on the Arduino? You'd have to program in the date and time and you could have it count from that point on. But if it lost power, you'd have to reset the time. Much like very cheap alarm clocks: every time they lose power they blink 12:00

While this sort of basic timekeeping is OK for some projects, some projects such as data-loggers, clocks, etc will need to have consistant timekeeping that doesnt reset when the Arduino battery dies or is reprogrammed. Thus, we include a seperate RTC! The RTC chip is a specialized chip that just keeps track of time. It can count leap-years and knows how many days are in a month, but it doesn't take care of Daylight Savings Time (because it changes from place to place)

ADF-RTC-DS1307-INTRO1.jpg

This image shows a computer motherboard with a Real Time Clock called the DS1387. Theres a lithium battery in there which is why its so big.

The RTC we'll be using is the DS1307. It's low cost, easy to solder, and can run for years on a very small coin cell.

ADF-RTC-DS1307-INTRO-ds1307.jpg

As long as it has a coin cell to run it, the DS1307 will merrily tick along for a long time, even when the Arduino loses power, or is reprogrammed.

Fichiers

Schematic and layout files can be found at GitHub - click Download Source to get the zip!


Source: DS1307 Real Time Clock Breakout Board Kit. Ecrit par Tyler Cooper pour AdaFruit. Crédit AdaFruit Industries

Traduit par Meurisse D. pour MCHobby.be

Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.