# 时钟模块

## 概述

时钟RTC模块，可以实现实时时钟功能，就是像时钟一様可以输出实际时间的电子设备。目前实时时钟芯片大多采用精度较高的晶体振荡器作为时钟源，我们采用DS1307时钟芯片，32.768KHz圆柱体晶振作为时钟源。

## 参数

* 工作电压：5V
* 通信接口：I2C/IIC（Gravity PH2.0-4P接口 & 排针）
* 芯片可输出数据：年、月、日、星期、时、分、秒。
* 自动闰年补偿计算
* 保证准确日期到2100年
* 1Hz输出插口
* 56字节的非易失性内存
* 4KB的只读内存（EEPROM
* 消耗功耗低，有时会比其他方式的输出时钟要更准确。
* DS1307时钟芯片，输入电压4.5-5.5V，典型值5.0V。I2C接口，SCL，SDA引脚电压5V。SQW/OUT（方波/输出驱动）引脚当启用时，位设置为1，该引脚输出四个方波频率（1Hz、4kHz，8kHz，32kHz）。SQW /引脚是开漏输出所以需要外部上拉电阻。该引脚可以在电源或者电池供电下都能工作。
* 32.768KHz圆柱体晶振，圆柱插件3\*8规格，精度10PPM。
* 电池电压2.0-3.5V,采用CR1220纽扣电池，标称电压3.0V。

## 接口说明

* 可用端口： C0、C1、M0、M1、M2、M3

## 使用方式

![](/files/-LWJlLBMnL2syeVrhNjP)

## 示例代码

![](/files/-LWJlLBOWCShYB7Yjqso)

[时钟模块示例代码](http://www.haohaodada.com/show.php?id=955399)

## 原理图

{% file src="/files/-LrCXZd\_2t4f0KfMa44F" %}
时钟模块原理图
{% endfile %}

## 尺寸说明

![](/files/-LWJlLBQ9HlSv_7rEmzF)

## 相关资源

{% file src="/files/-LrHKE-DEbxBqnItHPaD" %}
DS1307芯片说明
{% endfile %}

## 常见问题


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.haohaodada.cn/jiao-xue-chan-pin/nova-module/shi-zhong-mo-kuai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
