I'm using the BF538F EZKIT and am trying to sample from an external device every 960Hz. I'm trying to set up the core timer to toggle an LED on the EZKIT board to see if it's working. Using the core timer registers in the HRM:
TCNTL = 0x0007; // enables the timer and sets it to auto reload
TCOUNT = 5000;
TPERIOD = 5000;
TSCALE = 100;
If my CCLK is running at 400MHz, the LED should toggle at 800 Hz with these settings.
When i run the code below no LEDs turn on (i know the LED code works from toggling a different LED inside the while loop earlier). Do i have to enable interrupts somehow, or am i missing some time initialization?
Also is using the core timer a good/simple way to get me the continual 960Hz I need (i only need about +/- 3 Hz accuracy)? But regardless I'd like to figure out what I'm doing wrong here.