I tried setting BASE+0x80 to 0xA later but it didn't do anything. Also I checked the ARM Linux code to see how it dealt with the same timer, and it set the Value register; tried doing the same, that's why it's there. Actually I checked the code I posted in PM, and it did work to a certain extent, but now I remember the issue was with setting the Load register. It's as if it took some time before the timer became aware of the new value, and consequently measuring intervals became a mess. Well now I just decided not to play with the Load register at all. Here's the code that works for any future wanderer that might end up in this thread:
#include <os.h>
int main(void) {
volatile unsigned *value = (unsigned *)0x900C0004;
volatile unsigned *control = (unsigned *)0x900C0008;
int i;
*(volatile unsigned *)0x900B0018 &= ~(1 << 11);
*(volatile unsigned *)0x900C0080 = 0xA;
*control = 0b10100010;
unsigned start = *value;
for(i = 0; i < 10; ++i) {
printf("timer: %u\n", *value);
sleep(100);
}
printf("diff: %u\n", start - *value);
return 0;
}
Thanks again.