6116 views|6 replies

931

Posts

3

Resources
The OP
 

GD32E230C Test 1: Simple Date and Time Display [Copy link]

    The system tick was used to display the date and time. Since no clock chip was added, the clock of this test project is not very accurate, with an error of several seconds per hour. Although the interruption time of the system tick can be adjusted through code, this is just an experiment, not a practical use, so I will not pursue accuracy. The following figure shows the date and time displayed on the development board: Since no clock chip was added, the date and time must be adjusted after booting up. The adjustment is done through the two onboard buttons Wakeup and Tamper. The Wakeup button is responsible for function selection. The default function is normal operation. After pressing the button, the year, month, day, hour, minute, and second are adjusted in turn. The following figure shows the year being adjusted, and the current adjustment value is displayed in reverse. The Tamper button is responsible for adjusting the value. The year ranges from 2010 to 2029. The date simply handles the big and small months and leap months in this year. The time is based on the 24-hour system. Since the long and short keys have not been debugged, the value adjustment is simply adding 1, and there is no function of quick adjustment or subtracting 1. The following is the package file of this test project, and those who are interested can download it for reference: text1.rar (442.24 KB, downloads: 100)





This post is from GD32 MCU

Latest reply

There are examples in the package, which can be directly transplanted  Details Published on 2019-2-27 16:33
 

5303

Posts

454

Resources
2
 
GD32E230 has an internal RTC
This post is from GD32 MCU

Comments

Thanks for the advice! But I don't know how to use it yet, I'll learn it slowly.  Details Published on 2019-2-27 16:11
 
 
 

931

Posts

3

Resources
3
 
This post was last edited by hujj on 2019-2-27 16:17Thank you for your advice! But I don't know how to use it yet, and I will slowly explore it. My main purpose of this exercise is to familiarize myself with the key operation and LCD control, and the date and time display are incidental. The next step is to familiarize myself with the control of RTC.
This post is from GD32 MCU

Comments

There are examples in the package, which can be directly transplanted  Details Published on 2019-2-27 16:33
 
 
 

5303

Posts

454

Resources
4
 
hujj posted on 2019-2-27 16:11 Thank you for your advice! But I don't know how to use it yet, so I'll learn it slowly. My practice is mainly to get familiar with the key operation and LCD control, and the date and time display...
There are examples in the package, which can be directly transplanted
This post is from GD32 MCU
 
 
 

931

Posts

3

Resources
5
 
    I initially transplanted the RTC program in the DEMO, which can display the year, month, day, hour, minute, and second. However, because this DEMO example refreshes the screen in the main loop, the display flickers slightly, which also affects my original timing, causing the software timing to be much slower. After testing, the RTC clock is not affected by reset, unlike my original software timing, which needs to be reset after each reset, but the original RTC still needs to be reset after powering on again.
This post is from GD32 MCU
 
 
 

931

Posts

3

Resources
6
 
    After debugging, the engine for time display was replaced with RTC, and the system tick was no longer used. However, the timing of this RTC was inaccurate, and it was more than ten seconds faster per minute. Perhaps there was something wrong with the settings.
This post is from GD32 MCU
 
 
 

931

Posts

3

Resources
7
 
    Through testing, I found that the advantage of using RTC is that the data is not affected by reset (it still needs to be reset when the machine is turned on). It is estimated that the data is placed in the flash register. The disadvantage is that the timekeeping error is relatively large. In addition, the year is counted in two digits, and 2000 needs to be added manually. In addition, it uses 4 binary digits to correspond to 1 decimal digit, which is convenient for display, but not so convenient for calibration. After comprehensive consideration, I still switched back to the system tick for timing, because this is an experiment after all, and it is really practical to use a timing chip. Today, I ordered a DS1302, so that the clock can be kept running by battery, and there is no need to calibrate the time every time the machine is turned on.
This post is from GD32 MCU
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list