DIY编程器网

 找回密码
 注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 241|回复: 0
打印 上一主题 下一主题

使用DS1307的PIC单片机-Using a DS1307

[复制链接]
跳转到指定楼层
楼主
发表于 2011-4-29 22:25:08 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Abstract: This application note is intended to demonstrate an application using the DS1307 Real-Time Clock with a Microchip PIC microcontroller. The software example includes basic operating routines, and a schematic of the application circuit is included.

DiscussionThis application note demonstrates how to use the DS1307 real-time clock (RTC) with a Microchip PIC16F628 microcontroller.

The example code, written in assembly code, includes a routine for reading the time and date from the RTC and a routine to write time and date data to the RTC from user entries.


OperationThe program uses two general-purpose port pins on the microcontroller to communicate with the DS1307 using the I2C serial interface. The microcontroller's internal UART drives two port pins, which are connected to a DS232 line driver/receiver. User inputs and data outputs from the program are passed through the RS-232 interface from a terminal emulator program on a PC to the microcontroller. The RS-232 DTR input line controls the microcontroller's reset input.

The microcontroller in this example is a PIC16F628. For information on the microcontroller used in this application note, including available programming tools, visit the Microchip web site.

The software is shown in Figure 1. A schematic of the circuit is shown in Figure 2.




Download (TXT, 10kB)
Figure 1. Program Listing




More detailed image (PDF, 126kB)
Figure 2. Schematic drawing of the DS1307 circuit used with a PIC microcontroller.

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏 分享分享 支持支持 反对反对
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|文字版|手机版|DIY编程器网 ( 桂ICP备14005565号-1 )

GMT+8, 2024-11-16 10:23 , 耗时 0.079583 秒, 18 个查询请求 , Gzip 开启.

各位嘉宾言论仅代表个人观点,非属DIY编程器网立场。

桂公网安备 45031202000115号

DIY编程器群(超员):41210778 DIY编程器

DIY编程器群1(满员):3044634 DIY编程器1

diy编程器群2:551025008 diy编程器群2

QQ:28000622;Email:libyoufer@sina.com

本站由桂林市临桂区技兴电子商务经营部独家赞助。旨在技术交流,请自觉遵守国家法律法规,一旦发现将做封号删号处理。

快速回复 返回顶部 返回列表