Single chip real-time clock circuit (LCD1602, PCF8563)

Publisher:BlissfulMomentsLatest update time:2022-08-24 Source: elecfansKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. Introduction

This circuit mainly consists of 51 single chip microcomputer, LCD1602 module, PCF8563 chip and buttons. The current time is displayed through LCD1062, and the time can be set by buttons.


2. Operation Effect

insert image description here

3. Partial Code

/*Want more projects private wo!!!*/

#include

#include

#define uchar unsigned char

#define uint unsigned int



void init()

{

flying number;

lcden=0;

write_com(0x38); //0011 1000B, function mode setting, set to 8 as data port, two-line display, 5*7 dot matrix

write_com(0x0c); //0000 1011B, display on and cursor setting, display off, display cursor, cursor flashing

write_com(0x06); //0000 0110B, display cursor movement setting, read or write a character, the address pointer decreases by one and the cursor decreases by one, write a character and the screen display does not move

write_com(0x01); //0000 0001B, clear the display, data pointer and all displays

write_com(0x80); //1000 000B, turn off display

delay1602(5);

write_com(0x80); //1000 000B, set to 2 lines display, write the address of the first line of characters, the first line address is 00-2F

for(num=0;num<15;num++)

{

write_date(table[num]); //Write the first row of data

delay1602(5);

}

write_com(0x80+0x40); //1100 0000B, set to 2 lines of display, write the address of the second line of characters, the address of the second line is 40-67

for(num=0;num<15;num++) //Write the second line of data

{

write_date(table1[num]); //Write the second row of data

delay1602(5);

}


/********************************************

Read time into internal buffer ---- external call 

********************************************/

void P8563_gettime()

{

    P8563_Read();

    if(g8563_Store[0]==0)

      P8563_Read(); /*If seconds = 0, read again to prevent time changes*/

}


//---Main function---//

void main()

{

P8563_init();

heat();

while(1)

{

P8563_gettime();

BCD_16( );

display();

key_scan(); 

  }

}

Keywords:MCU Reference address:Single chip real-time clock circuit (LCD1602, PCF8563)

Previous article:Single chip design of ultrasonic distance measurement simulation
Next article:Single chip microcomputer design to measure frequency

Recommended ReadingLatest update time:2024-11-16 15:35

Application of Timer/Counter of PIC16F87X MCU
The PIC16F87X microcontroller has three timer/counters configured inside, which are TMR0, TMR1, and TMR2. These three timer/counter modules are not only different in circuit structure, but also different in design intention and use. Timer/Counter TMR0. Timer/Counter TMR0 is the most commonly used device among the th
[Microcontroller]
Application of Timer/Counter of PIC16F87X MCU
Universal USB interface module design AVR microcontroller
1 Introduction The USB interface has become one of the main ways for peripherals to communicate with PCs due to its fast data transmission, simple connection, easy expansion, and hot-swap support. With the development of embedded systems, embedded microprocessors need to add a universal USB interface to achieve commun
[Microcontroller]
Universal USB interface module design AVR microcontroller
Design of DC power collection charger based on single chip microcomputer
  In recent years, the problem of energy shortage has become increasingly prominent. While people are worried about energy depletion, the waste of energy is alarming. For example, various discarded batteries, especially those used in remote control toy cars, are discarded before even half of their energy is used. This
[Microcontroller]
Design of DC power collection charger based on single chip microcomputer
Programming of single chip digital stopwatch timer
This time, I made an experimental digital stopwatch display of the 51 single-chip microcomputer, using the timer, interrupt service function, dynamic display of the digital tube, and logical considerations of the program. This is my first time writing here. I don’t have enough experience and the layout is not beautifu
[Microcontroller]
Principle of 80C196MC microcontroller waveform generator and its application in inverter power supply
    Abstract: The SPWM waveform generation principle and software design points of the 80C196MC waveform generator. The inverter control circuit realizes full digital operation and improves the traditional control method. Tests show that this solution has compact structure, good dynamic characteristics and high relia
[Power Management]
Using CH372 to realize the communication function between USB disk and single chip microcomputer
  The program design of this system mainly includes two parts, namely the firmware program of the USB interface part and the CH372 driver on the computer side. The former mainly includes the initialization of the single-chip microcomputer and CH372, the read-write interface program and the interrupt service program; t
[Microcontroller]
Using CH372 to realize the communication function between USB disk and single chip microcomputer
How to use STC89C52 microcontroller to make a multiple signal generator
First, paste the simulated circuit diagram below (the simulation software is Protuse, upload a larger diagram so that everyone can see it clearly): Original parts list: STC89C52 microcontroller . Simulation requires these original parts. The specific hardware design is finalized and is being produced~ Upload the C p
[Microcontroller]
How to use STC89C52 microcontroller to make a multiple signal generator
MCU dual-machine communication Very detailed UART serial port asynchronous communication
1. Overall design 1. Design requirements: Serial communication is carried out between the two microcontrollers. The sending end sends 0~f loop to the receiving end, and it is displayed on the receiving end. 2. Design plan: In this design, for two 89C51 chips, RS232 is used for dual-machine communication. The data of
[Microcontroller]
MCU dual-machine communication Very detailed UART serial port asynchronous communication
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号