Hi rPi friends,
I have found a strange behaviour of the clock and can't locate what is going wrong.
For example:
I wrote a module which observes GPIO17 and 21 and generates an interrupt whenver the signale changes.
I gave a 10khz signal to the GPIO-pins an measured the time between the signal changes (about 50us).
So far so good. Then I wrote the level change with printk into my messages log and first everything looked fine.
A python script calculated the time difference between the falling edge and the rising edge an the results we pretty good.
But then there was a really weird time value in the log file and this appears more often than once.
Here an example from my log:
Jun 24 11:13:19 raspberrypi kernel: [13510.337288] Xanonex: falling
Jun 24 11:13:19 raspberrypi kernel: [13510.337354] Xanonex: rising
Jun 24 11:13:19 raspberrypi kernel: [13510.337422] Xanonex: falling
Jun 24 11:13:19 raspberrypi kernel: [13191.882357] Xanonex: rising <-- look at this time difference
Jun 24 11:13:19 raspberrypi kernel: [13510.337492] Xanonex: falling
Jun 24 11:13:19 raspberrypi kernel: [13510.337544] Xanonex: rising
So this kernel time can't be true. Before, I wrote another programm polling a gpio-port and calculated the differenz (but only at 10hz) and here also I got really weird calculations sometimes,too.
It seems like I access the clock while it is internally updated or something like this. Is there a way to avoid this?
Oh, I forgot to mention that I use Raspian 3.6.11
Thank you much in advance for any help on this topic.