|
Message
From: =?unknown-8bit?Q?Gy=F6rgy?= 'nog' Jeney<nog@s...>
Date: Tue Sep 27 19:56:56 CEST 2005
Subject: [openrisc] how to use tick timer exception?
> mtspr(SPR_TTMR,0xa0001000L);//set TTMR[M]=2,TTMR[IE]=1 > mtspr(SPR_TTCR,0x00000000L); > mtspr(SPR_SR, SPR_SR_TEE | mfspr(SPR_SR));//set SPR_SR_TEE =1
You pretty much race the timer here.. First you should disable the timer and clear any pending timer interrupt (write a 0 to TTMR), then set TTCR to 0, enable TEE and then set your timing mode (write 0xa0001000 to TTMR in your case).
> i run it on or1200 > i found that the TTMR_IP is set "1" automatically sometimes.
What does `sometimes' mean? Could you try again with the above suggestion?
nog.
|
 |