ENGLISH 简体中文 日本語 한국어  

    Login | Register 


   
 
请输入关键词或器件型号    




应用笔记3921

Using a DS1307 with a PIC Microcontroller

Abstract: This application note is intended to demonstrate an application using the DS1307 real-time clock (RTC) with a Microchip PIC microcontroller. The software example includes basic operating routines. A schematic of the application circuit is included.

Discussion

This 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.

Operation

The program uses two general-purpose port pins on the microcontroller to communicate with the DS1307 using the I²C 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.

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

Figure 1. Program Listing

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

Figure 2. Schematic drawing of the DS1307 circuit used with a PIC microcontroller.


相关型号  APP 3921: Sep 29, 2006
DS1307 64 x 8、串行、I²C实时时钟 完整的数据资料
(PDF, 304kB)
免费样品
DS1337 I²C串行实时时钟 完整的数据资料
(PDF, 240kB)
免费样品
DS1338 I²C RTC,带有56字节NV RAM 完整的数据资料
(PDF, 268kB)
免费样品
DS1338 I²C RTC,带有56字节NV RAM 完整的数据资料
(PDF, 268kB)
免费样品
DS1339 I²C串行实时时钟 完整的数据资料
(PDF, 208kB)
免费样品
DS1340 I²C RTC,带有涓流充电器 完整的数据资料
(PDF, 240kB)
免费样品
DS1388 I²C RTC/监控电路,带有涓流充电器和512字节EEPROM 完整的数据资料
(PDF, 256kB)
免费样品

自动更新
需要自动接收最新发布的应用笔记吗?请订阅EE-Mail™ (English only)。




我们期待您的反馈!
喜欢?不喜欢?有待改善?或为我们提供建议?请与我们联系 — 我们将根据您的意见或建议改善我们的工作。 网页评价或提供建议

 

下载,PDF格式下载,PDF格式 (39kB)
 AN3921, AN 3921, APP3921, Appnote3921, Appnote 3921

        •         •         •     隐私权政策     •     法律声明

    © 2009 Maxim Integrated Products版权所有