3761 views|18 replies

3255

Posts

0

Resources
The OP
 

The product cannot be connected to the Internet, and the displayed time cannot be updated through the network. The LCD displays the date and time inaccurately. From which angles can it be solved... [Copy link]

 

The product cannot be connected to the Internet, and the displayed time cannot be updated through the network. The LCD displays the date and time inaccurately. How can this be solved? The RTC external clock is used, and the crystal oscillator runs at 32.768K (why not use other frequencies?)

This post is from 51mcu

Latest reply

The module baud rate is fixed at 115200? In this case, the 4M crystal oscillator is indeed difficult. In addition, why does the baud rate error affect the timing? Isn't the module used to send the standard time to the MCU (for example, the module informs the MCU at 12:00:00 every day, and the MCU can adjust the time according to this time)? There is no need to use the module for real-time correction, the accuracy of the RTC within a day should still be within the allowable range.   Details Published on 2021-8-2 14:45
 

1w

Posts

25

Resources
2
 

32.768K crystal can take into account power consumption, cost and accuracy. For higher accuracy, a temperature compensated crystal is needed. However, even the best crystal will have errors over time and needs to be corrected by certain methods, such as radio waves, GPS, WIFI, etc.

This post is from 51mcu

Comments

The key is that there is no wireless transmission module. It is just an ordinary one without transmission. How to solve this problem? How did people achieve those electronic watches, electronic clocks, and perpetual calendars in the past? There is no calibration and no networking.  Details Published on 2021-7-3 18:05
 
 
 

3255

Posts

0

Resources
3
 
dcexpert published on 2021-7-3 17:21 32.768K crystal can take into account power consumption, cost and accuracy. For higher accuracy, a temperature compensated crystal oscillator is required. However, no matter how good the crystal oscillator is, it will have errors over time and needs...

The key is that there is no wireless transmission module. It is just an ordinary one without transmission. How to solve this problem? How did people achieve those electronic watches, electronic clocks, and perpetual calendars in the past? There is no calibration and no networking.

This post is from 51mcu

Comments

Electronic watches are manually calibrated  Details Published on 2021-7-3 19:07
 
 
 

1w

Posts

25

Resources
4
 
QWE4562009 Published on 2021-7-3 18:05 The key is that there is no wireless transmission module. It is just an ordinary one without transmission. How to solve this problem? In the past, those electronic...

Electronic watches are manually calibrated

This post is from 51mcu

Comments

How to calibrate manually? Can I send commands directly through the serial port? Or do I need to use a host computer?  Details Published on 2021-7-5 15:35
 
 
 

6609

Posts

0

Resources
5
 

Since it cannot be calibrated online, there is no wireless network control function.

In addition to manual operation, how can I make it adjust the calibration intelligently?

Is it by intention?

This post is from 51mcu
 
 
 

2721

Posts

0

Resources
6
 

What should I do if the button battery is dead and the clock does not update automatically? - Microcontroller - Electronic Engineering World - Forum https://bbs.eeworld.com.cn/thread-522249-1-1.html

This post is from 51mcu
 
 
 

2146

Posts

8

Resources
7
 

It's the same as an ordinary electronic perpetual calendar. You just need to calibrate it manually regularly. There is no other way.

No matter how high the crystal precision is, there will still be errors. For example, if the crystal is 10ppm, there will be an error of 1 minute in more than 2 months. It depends on whether you can accept this error.

Do you really need such high-precision time measurement? If it is not important, just leave a setting that can be adjusted manually.

32.768k is more commonly used. There are also 32k RTCs. It depends on what the chip manufacturers think.

This post is from 51mcu

Comments

For example, if the value is 10ppm, there will be a 1 minute error in more than 2 months. How is this calculated?  Details Published on 2021-7-5 15:36
 
Personal signature坐而言不如起而行
 
 

216

Posts

0

Resources
8
 
Using a real-time clock chip
This post is from 51mcu
 
 
 

3255

Posts

0

Resources
9
 
dcexpert posted on 2021-7-3 19:07 Electronic watches are manually calibrated

How to calibrate manually? Can I send commands directly through the serial port? Or do I need to use a host computer?

This post is from 51mcu

Comments

A long time ago, people used television or radio to tell the time on time, and then used electronic watches to adjust the time. If the serial port can send commands, the computer time can be synchronized.  Details Published on 2021-7-5 17:25
 
 
 

3255

Posts

0

Resources
10
 
wsmysyn posted on 2021-7-4 10:47 It is the same as an ordinary electronic perpetual calendar. You just need to calibrate it manually regularly. There is no other way. No matter how high the precision of the crystal is...

For example, if the value is 10ppm, there will be a 1 minute error in more than 2 months. How is this calculated?

This post is from 51mcu

Comments

It is just a math problem. The accuracy of the crystal is 10ppm, which means that the error is 10 seconds for 1 million seconds, 10 minutes for 1 million minutes, and 1 minute for 100,000 minutes. It is obvious how long 100,000 minutes is.   Details Published on 2021-7-5 15:43
 
 
 

2146

Posts

8

Resources
11
 
QWE4562009 posted on 2021-7-5 15:36 For example, if it is 10ppm, there will be a 1 minute error in more than 2 months. How is this calculated?

It's just a math problem. The crystal accuracy is 10ppm.

This means that the error in 1 million seconds is 10 seconds.

1 million minutes error 10 minutes,,

100,000 minutes has an error of 1 minute. It is obvious how long 100,000 minutes is.

This post is from 51mcu

Comments

---There is another question. If you can connect to the Internet, there is also a baud rate error problem. That is, the baud rate sent by the GPS module to the MCU (because the final LCD display is displayed by the MCU). If the baud rate is 115200, the actual value is 11500.  Details Published on 2021-7-5 16:20
 
Personal signature坐而言不如起而行
 
 

3255

Posts

0

Resources
12
 
wsmysyn posted on 2021-7-5 15:43 It is just a math problem. The accuracy of the crystal is 10ppm, which means that the error of 1 million seconds is 10 seconds, the error of 1 million minutes is 10 minutes, and the error of 100,000 minutes is...

---There is another question. If the network can be connected, there is also the problem of baud rate error. That is, the baud rate sent by the GPS module to the MCU (because the final LCD display is displayed by the MCU). If the baud rate is 115200 and the actual value is 11500, can the error of one day be calculated? There is also an error.

This post is from 51mcu

Comments

This can be estimated. Even if the baud rate is accurate, there will be errors. When you send data, it takes a certain amount of time to receive, parse, and update the data. For example, the data sent takes up 14 bytes (year, month, day, hour, minute, and second). The actual time may be longer than this. For example, the definition of the data frame header and tail is  Details Published on 2021-7-5 16:45
 
 
 

2146

Posts

8

Resources
13
 
This post was last edited by wsmysyn on 2021-7-5 16:49
QWE4562009 posted on 2021-7-5 16:20 --- There is another question. If it can be connected to the Internet, there is also a problem of baud rate error. That is, the GPS module sends to the MC...

This can be estimated. Even if the baud rate is accurate, there will be errors. When you send data, it takes a certain amount of time to receive, parse, and update data. For example, the data sent occupies 14 bytes (year, month, day, hour, minute, and second. The actual time may be longer than this, such as defining the data frame header, frame tail, and checksum). 14 bytes are a total of 112 bits. It takes about 1ms for the serial port to send 112 bits. That is, if you write the sent time directly, it is actually 1ms later than the standard time. However, this 1ms is fixed. If you know this error, you can compensate for it when writing to offset this fixed error. The main source of error is the cumulative error of the crystal. The more accurate the crystal, the more precise the time, and the longer the interval required for calibration. Conversely, the worse the crystal accuracy, the shorter the interval required for calibration.

When I was a kid, I had an electronic watch, the kind with a 32k crystal attached to the RTC, the error was very large, the accuracy was probably only a few hundred ppm, it could be a few minutes faster in a day or two, and it could be a day or two faster every few months, and I often had to adjust the time manually.

This post is from 51mcu

Comments

You said a lot, thank you, but I still don't know how to calculate the error. For example, the baud rate is 115200, but it is actually 11500 or 11000. In this case, can the error of one day be calculated?  Details Published on 2021-7-5 18:28

赞赏

1

查看全部赞赏

 
Personal signature坐而言不如起而行
 
 

1w

Posts

25

Resources
14
 
QWE4562009 posted on 2021-7-5 15:35 How to calibrate manually? Can I send commands directly through the serial port? Or do I need to build a host computer

A long time ago, people used television or radio to tell the time and set the time using electronic watches.

If the serial port can send commands, the computer time can be synchronized.

This post is from 51mcu

Comments

When sending commands through the serial port, it is also necessary to prepare the protocol in the target board program first, right? "  Details Published on 2021-7-5 18:29
 
 
 

3255

Posts

0

Resources
15
 
wsmysyn posted on 2021-7-5 16:45 QWE4562009 posted on 2021-7-5 16:20 --- Another question. If it can be connected to the Internet, there is also a baud rate error...

You said a lot, thank you, but I still don't know how to calculate the error. For example, the baud rate is 115200, but it is actually 11500 or 11000. In this case, can the error of one day be calculated?

This post is from 51mcu
 
 
 

3255

Posts

0

Resources
16
 
dcexpert posted on 2021-7-5 17:25 A long time ago, people used television or radio to tell the time on time and set the time on electronic watches. If the serial port can send commands, ...

When sending commands through the serial port, it is also necessary to prepare the protocol in the target board program first, right? "

This post is from 51mcu

Comments

That's natural. There is no standard protocol for serial communication. You can set it according to the situation. If it is a network method, it is calibrated using NTP.  Details Published on 2021-7-6 17:40
 
 
 

1w

Posts

25

Resources
17
 
QWE4562009 posted on 2021-7-5 18:29 When sending commands through the serial port, it is also necessary to prepare the protocol in the target board program first, right? ""

That's natural. There is no standard protocol for serial communication. You can set it according to the situation. If it is a network method, it is calibrated using NTP.

This post is from 51mcu
 
 
 

3255

Posts

0

Resources
18
 
If it can connect to the Internet, there is also the problem of baud rate error, which is the baud rate that the GPS module sends to the MCU (because the final LCD display is displayed by the MCU). If the baud rate is 115200 and it is actually 115000, can the error of one day be calculated? There is also an error. This is a practical problem encountered by a software engineer I work with. Because the MCU cannot run at such a high frequency, only a 4M crystal oscillator can be used, and then 115200 is required to communicate with the wireless module. Then, after calculation by the FAE of the original microcontroller factory, the required crystal oscillator is 7.0 MHZ, which also has this frequency. As a result, there is a deviation when it is put up, because the MCU does not support this crystal oscillator frequency, but there is no other way. It is impossible to change the chip because it involves algorithms and the chip replacement cycle is too long, so the error occurs... Can this error be calculated? Regarding the baud rate deviation that causes communication errors between the MCU and the wireless module, and then there is also an error in time.
This post is from 51mcu

Comments

The module baud rate is fixed at 115200? In this case, the 4M crystal oscillator is indeed difficult. In addition, why does the baud rate error affect the timing? Isn't the module used to send the standard time to the MCU (for example, the module tells the MCU at 12:00:00 every day, and the MCU can adjust the time according to this time)? There is no need to use the module in real time.  Details Published on 2021-8-2 14:45
 
 
 

30

Posts

3

Resources
19
 
QWE4562009 Published on 2021-7-7 11:53 If you can connect to the Internet, there is also a baud rate error problem, which is the baud rate sent by the GPS module to the MCU (because the final LCD display is displayed by the MCU) such as...

The module baud rate is fixed at 115200? In this case, the 4M crystal oscillator is indeed difficult. In addition, why does the baud rate error affect the timing? Isn't the module used to send the standard time to the MCU (for example, the module informs the MCU at 12:00:00 every day, and the MCU can adjust the time according to this time)? There is no need to use the module for real-time correction, the accuracy of the RTC within a day should still be within the allowable range.

This post is from 51mcu
 
 
 

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