2015-03-20 02:03 PM
Hello.
I'm using a custom board for charging and testing batteries. Its 'brain' is an STM32F407VGT6 microcontroller. I'm developing in Ubuntu (14.04.2 LTS), using ChibiStudio (ChibiOS/RT 3.0 development branch and Eclipse Kepler). While in charge mode, I need to see how much time has passed since I initially started charging the battery. I'm having trouble with writing the necessary steps required for the time measurement. The microcontroller has an internal real-time clock (RTC). It also has timers. And ChibiOS has a time measurement function. However, I went through the documentation, researched online, but I still cannot make it work. Any help or guidance would be appreciated. Thank you. Alex Dumitrescu #stm32f407 #rtc #stm32f4-timer2015-03-20 05:23 PM
Ok, what level of accuracy are you looking for?
If you can read the current time, you can presumably store a starting time, and then compare/difference that with the current time later on, right? If you have a millisecond (1KHz) ticker, you can count off time with that. What programming experience do you have?2015-03-21 02:05 AM
It seams for me that for battery charging ms accuracy
will be enough. In this case you can use next ChibiOS functions http://chibios.sourceforge.net/docs3/rt/group__time.html. Pay attention that all functions usually use system ticks - not ms, so you need to ST2MS & MS2ST macros.
Accuracy of system time set by CH_CFG_ST_FREQUENCY define.