Good question, I see a lot of names there, the BSD license is not a problem but we should ask the author anyway. It looks well written too.
Giovanni
The RTC driver topic
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: The RTC driver topic
Giovanni wrote:but we should ask the author anyway
Could you do that as an author of ChibioOS.
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Has thanked: 3 times
- Been thanked: 3 times
Re: The RTC driver topic
I found that RTCD is not implemented on stm32F0xx platform. Support for this MCU is planned?
- Giovanni
- Site Admin
- Posts: 14893
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: The RTC driver topic
Many thanks for ChibiOS. Made it easy to start using STM32. I found the wrong job for RTCv1 stm32f1.
The initial conditions and settings:
1. stm32f100c8, external crystal resonator 32768 for RTC and has battery backup.
2. settings:
Test 1:
1. connect the battery;
2. connect the main power;
3. read RTC->PRLL(RTC->PRLH), has a value of 32770, all is well;
4. tune time.
Test 2:
1. turning off the main power;
2. Turning on the main power;
3. read RTC->PRLL(RTC->PRLH), has a value of 32768, value is reset to the default value;
4. reading time, time correctly.
Is that correct?
I do not understand why RTC->PRLL(RTC->PRLH) reset to the default value?
Sorry for my bad english
The initial conditions and settings:
1. stm32f100c8, external crystal resonator 32768 for RTC and has battery backup.
2. settings:
Code: Select all
#define STM32_LSECLK 32770
#define STM32_HSECLK 8000000
#define STM32_NO_INIT FALSE
#define STM32_HSI_ENABLED TRUE
#define STM32_LSI_ENABLED TRUE
#define STM32_HSE_ENABLED TRUE
#define STM32_LSE_ENABLED TRUE
#define STM32_SW STM32_SW_PLL
#define STM32_PLLSRC STM32_PLLSRC_HSE
#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1
#define STM32_PLLMUL_VALUE 3
#define STM32_HPRE STM32_HPRE_DIV1
#define STM32_PPRE1 STM32_PPRE1_DIV1
#define STM32_PPRE2 STM32_PPRE2_DIV1
#define STM32_ADCPRE STM32_ADCPRE_DIV2
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
#define STM32_RTCSEL STM32_RTCSEL_LSE
#define STM32_PVD_ENABLE FALSE
#define STM32_PLS STM32_PLS_LEV0Test 1:
1. connect the battery;
2. connect the main power;
3. read RTC->PRLL(RTC->PRLH), has a value of 32770, all is well;
4. tune time.
Test 2:
1. turning off the main power;
2. Turning on the main power;
3. read RTC->PRLL(RTC->PRLH), has a value of 32768, value is reset to the default value;
4. reading time, time correctly.
Is that correct?
I do not understand why RTC->PRLL(RTC->PRLH) reset to the default value?
Sorry for my bad english
Re: The RTC driver topic
@VVo
Because that registers are write only. Sure, you can read them but value will be incorrect. Use RTC_DIVH / RTC_DIVL instead
P.S. welcome to ChibiOS.
Because that registers are write only. Sure, you can read them but value will be incorrect. Use RTC_DIVH / RTC_DIVL instead
P.S. welcome to ChibiOS.
Re: The RTC driver topic
Not so easy. If you do not turn off the main power the clock will go right (divider 32770). After a power off-on the clock runs slower (divider 32768). That is, the clock is correct to the first power outage.
Last edited by VVo on Thu Sep 18, 2014 11:28 am, edited 1 time in total.
Re: The RTC driver topic
What does it matter if, after a power failure the clock starts to go slower? The device operates year. Would like to adjust the accuracy. Compared with the clock on my computer, which is synchronized with the network. First, the problem revealed that the clock does not depend on STM32_LSECLK. Then I found out that depends, but after a power reset to 32768 and the clock runs slower.
Last edited by VVo on Thu Sep 18, 2014 11:50 am, edited 1 time in total.