2476 views|7 replies

7170

Posts

195

Resources
The OP
 

[Jihai APM32E103VET6S MINI development board review] RTC test [Copy link]

 

APM32 has a built-in RTC as shown below

It says that you can choose LSI, so I want to test the accuracy of using LSI.

I have used ST products, and LSI products are not very accurate either. Some products require software calibration before they can be used.

Look at the APM32E103 manual

There is no typical value for LSI. I think the difference in LSI may be very large.

Look at the APM32F103 manual again

It is worthwhile for LSI, so APM32E103 should have been cut down in some way.

The program code is shown in the figure

I tested it with a stopwatch for about a minute.

The error is really large, almost more than twice.

This post is from Domestic Chip Exchange

Latest reply

How to get accurate timing with LSI: Analysis of the reasons for inaccurate data: The default division factor is 32768. If you choose to use the external LSE clock 32.768KHZ, you can get a more accurate 1S clock timing. The calculation method is fLSE/division factor = counting frequency. 32768Hz/32767 is approximately equal to 1Hz. When LSE is replaced by LSI, the clock of LSI varies between different chips, with a typical value of about 40KHz. You can choose a frequency division that is easy to measure, use the second interrupt to output the divided clock frequency, and invert the accurate LSI. Then adjust the frequency division coefficient based on the calculated LSI to get a relatively accurate 1Hz signal. 1. Use the program provided by the original poster to adjust the frequency division factor to 40. It is estimated that the second interrupt frequency can be around 1KHz. Use an oscilloscope to calculate or make a timer capturer yourself, capture the frequency, and then infer the real frequency of the LSI. 2. Modify the frequency division coefficient according to the actual frequency of LSI to obtain relatively stable RTC clock data   Details Published on 2022-10-14 18:06
 
 

6818

Posts

11

Resources
2
 

I tested it with a stopwatch for about a minute.

The error is really large, almost more than twice.

I learned a lot. Thanks for sharing!

This post is from Domestic Chip Exchange
 
 
 

538

Posts

1

Resources
3
 
Is this large error caused by the MCU itself or is it related to the program or surrounding components?
This post is from Domestic Chip Exchange

Comments

The official program uses LSI APM32E103, which does not have LSI maximum and minimum values, while APM32F103 does.  Details Published on 2022-10-14 11:15
 
 
 

7170

Posts

195

Resources
4
 
Honghuzaitian posted on 2022-10-14 01:05 Is this large error caused by the MCU itself or is it related to the program or surrounding components?

The official program uses LSI APM32E103, which does not have LSI maximum and minimum values, while APM32F103 does.

This post is from Domestic Chip Exchange
 
 
 

5

Posts

0

Resources
5
 

I just checked the Geehy official website, the E103xE data sheet is https://www.geehy.com/uploads/tool/APM32E103xCxE%20%E6%95%B0%E6%8D%AE%E6%89%8B%E5%86%8C%20V1.3.pdf, and the accuracy of LSI is provided.

This post is from Domestic Chip Exchange

Comments

The version provided in the forum is different from this version. Only the new version has  Details Published on 2022-10-17 15:33
 
 
 

5

Posts

0

Resources
6
 

How to get accurate timing with LSI:

Analysis of the reasons for inaccurate data:

The default division factor is 32768. If you choose to use the external LSE clock 32.768KHZ, you can get a more accurate 1S clock timing. The calculation method is fLSE/division factor = counting frequency. 32768Hz/32767 is approximately equal to 1Hz.

When LSE is replaced by LSI, the clock of LSI varies between different chips, with a typical value of about 40KHz. You can choose a frequency division that is easy to measure, use the second interrupt to output the divided clock frequency, and invert the accurate LSI. Then adjust the frequency division coefficient based on the calculated LSI to get a relatively accurate 1Hz signal.

1. Use the program provided by the original poster to adjust the frequency division factor to 40. It is estimated that the second interrupt frequency can be around 1KHz. Use an oscilloscope to calculate or make a timer capturer yourself, capture the frequency, and then infer the real frequency of the LSI.

2. Modify the frequency division coefficient according to the actual frequency of LSI to obtain relatively stable RTC clock data

image.png (67.5 KB, downloads: )

image.png
This post is from Domestic Chip Exchange

Comments

There are many ways to do software compensation, but without calibration, the difference is not that big when using ST.  Details Published on 2022-10-17 15:34
 
 
 

7170

Posts

195

Resources
7
 
Uncle Weird posted on 2022-10-14 17:51 I just checked the Geehy official website, the data sheet of E103xE https://www.geehy.com/uploads/tool/APM32E103xCxE%20%E6%95%B0%E ...

The version provided in the forum is different from this version. Only the new version has

This post is from Domestic Chip Exchange
 
 
 

7170

Posts

195

Resources
8
 
Strange Uncle posted on 2022-10-14 18:06 How to get accurate timing made by LSI: Analysis of the reasons for inaccurate data: The default division factor of the host is 32768. If you choose to use external...

There are many ways to do software compensation.

It's just that without calibration, the difference is not that big after using ST

This post is from Domestic Chip Exchange
 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Featured Posts
Homemade STEVAL-IPM05F 3Sh board: FOC motor control 400V/8A non-sensing/sensing Hall/sensing encoder and other reference programs...

This post was last edited by music_586 on 2019-4-4 19:06 This content was originally created by EEWORLD forum user musi ...

Based on IPM05F 3Sh board: FOC motor control 400V non-sensing sensory encoder all design data summary (schematic diagram/BOM table...

Based on IPM05F 3Sh board: FOC motor control 400V sensorless and sensory encoder all design data summary (schematic diag ...

"Recommend Chinese chips" + domestic chips

I have used or seen quite a lot of domestic chips. I won't mention Shenwei and Loongson. Basically, anyone who works wit ...

Two highlights of EFM32PG22

I think the M33 core and 16-bit ADC are pretty good.

[HPM-DIY] HPM6750 uses cherryusb to read UVC camera to display VGA resolution

I received the display module from EE last week and finally used it tonight. HPM6750 acts as a host to read the UVC came ...

Is it possible to perform socket communication without IP and port number?

When using socket communication, whether it is internal communication within the local machine or communication betwee ...

全志V853 NPU 转换部署 YOLO V5 模型

# NPU conversion and deployment of YOLO V5 model This article takes the YOLO v5s model as an example to detail the conve ...

What is light load mode?

The technique of improving efficiency when using less output current is called light load mode. It is also called burst ...

[ST NUCLEO-U5A5ZJ-Q development board review] 2. EXTI, PWM and serial port printf

Serial port printf output The serial port 1 of Nucleo-U5A5 is connected to the serial port of STlinkV3 to output the pri ...

What are the functions of the five pins INT, MOSI, MISO, SCK, and NCS of the MPU attitude sensor? Is the waveform correct?

What are the functions of the five pins INT, MOSI, MISO, SCK, and NCS of the MPU attitude sensor? Is the waveform correc ...

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