On Wed, 19 Oct 2016 16:50:14 -0700 (PDT), Arthur Caio
<
art...@gmail.com> declaimed the following:
>Hello you all!
>
>I need to calculate hot much time it takes for an input to go from LOW to
>HIGH and then to LOW again. Basically, I want to know the period of a
>square wave generated by the LM555 timer.
>
Do you have some idea of what range the 555 is operating within?
I ask as a benchmark program I've been running on various boards
includes a step that determines the apparent resolution of time available
to the program -- and for my runs, the average as I recall (C
gettimeofday() is used by the program) was around 5uSec (I can't be more
precise as the data files are at work). That alone translates to a 200kHz
clock.
There are, no doubt, faster ticks available at a lower level of
programming.
>I am using Qt Creator and programming in C++.
>
>I am having trouble at programming this code in C++ for the beaglebone.
>
If using a polling loop with the file system access, you may be limited
to quite slower rates. The /sys filesystem is much too slow for precise
timing -- what with having to loop over open(), read(), close() while
looking for a state change.
MMIO (based upon a library for the DHT11) might be fast enough to
detect the transitions -- but then you have to worry about the resolution
of your accessible time base/counter (the DHT11 library didn't even bother
with timers -- the protocol is based upon short and long HIGH, with a fixed
length LOW, so it just counted loop cycles to compute a median, and
anything less than median was a short/0, anything longer than median was
long/1).
--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/