cancel
Showing results for 
Search instead for 
Did you mean: 

time managment

simval986
Associate II
Posted on September 18, 2014 at 18:45

Hi

, I have

a question to ask

I'm working

with the

STM32L

discovery board

.

Currently

a while loop

cyclically

acquires

data from two

external sensors.

I'd like to

know the

frequency with which

I acquire

data from the sensors

so that you can

manage

the time

of acquisition.

What is the

simplest way to

do it

??

Thanks in advance

.
3 REPLIES 3
Posted on September 18, 2014 at 19:44

What is the

simplest way to

do it

??

Toggle a GPIO, view period on a scope.

Read a time stamp from a free running counter.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
simval986
Associate II
Posted on September 19, 2014 at 13:20

Ok thanks Clive1. 

I tried using the functions RTC_GetTime and RTC_TimeStampShow but only the first works. Surely I forgot something in the configurations. 

However, the second function prints the seconds. 

As it is possible to obtain the sub-second in order to have a more precise measure of time? 

Thanks.

chen
Associate II
Posted on September 19, 2014 at 13:49

Hi

''As it is possible to obtain the sub-second in order to have a more precise measure of time? ''

Yes, the RTC does go down to 100ms (0.1S) resolution.

However, I think clive1 means use one of the timers NOT the RTC

The timers are derived off the system clock so can give you resolution in the uS (possibly nS depending on your clock)

I do not think the RTC has the resolution you need.