AnsweredAssumed Answered

i have a problem with the timer would any one help me

Question asked by mohamed on Jul 24, 2009
Latest reply on Jul 24, 2009 by mohamed

i am working on ADSP-TS201  and i was just checking the operation of the timer as i will need it in a certain application and i write this code and checked the assembly language in the assemble everything is okay but  i still don't know why it doeasn't work


* testing.c





#define SYSREG_CLR(sysreg,bit) __builtin_sysreg_write(sysreg, __builtin_sysreg_read(sysreg)&~bit)   //macro used to clear the bits
#define SYSREG_SET(sysreg,bit) __builtin_sysreg_write(sysreg, __builtin_sysreg_read(sysreg)|bit)  
//macro used to set bits

int main(void)          
unsigned int t;
unsigned int x;
int i;

__builtin_sysreg_write(__INTCTL,0x00000000);               // disable the timer

__builtin_sysreg_write(__TMRIN0H,0x0FFFFFFF);          // load the timer by this value

SYSREG_SET(__INTCTL, INTCTL_TMR0RN);                //run the timer and i checked that the bit was sit in the assembly code
  t= __builtin_sysreg_read(__TIMER0H);                          // the value of t should be derementing each clock cycle(300 MHZ)
  printf("t= %d\n",t);



thank you for your time