The sleep timer is supposed to be a 32kHz free running 24 bit tick counter. I want to use it to time various activities like blanking out a display after 2.5 seconds, so I keep reading the ST0, ST1 and ST2 registers to get the current tick count. When that has reached the desired value, I take the action. What I am finding is that the counter is not consistent nor seems to be running at 32kHz.
I've seen posts that reading the sleep timer count registers is touchy, but no solution has been provided, other than reading it multiple times or possibly busy waiting on ST0 changing before reading the other registers. I am not going into sleep mode, or even idle, while I am waiting, so the sleep timer count registers could be being read frequently, possibly in as little as 50uSecs.
I am investigating to see if I can narrow this down to a simple failure scenario.
Anyone have any experience of this, or can point me to a way to resolve this?
Thanks, Mark.