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

使用DS1307的PIC单片机-Using a DS1307,第1张

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

使用DS1307的PIC单片机-Using a DS1307,Figure 1. Program Listing,第2张
Download (TXT, 10kB)
Figure 1. Program Listing

使用DS1307的PIC单片机-Using a DS1307,Figure 2. Schematic drawing of the DS1307 circuit used with a PIC microcontroller.,第3张
More detailed image (PDF, 126kB)
Figure 2. Schematic drawing of the DS1307 circuit used with a PIC microcontroller.

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/dianzi/2438870.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-08-03
下一篇 2022-08-03

发表评论

登录后才能评论

评论列表(0条)

保存