Forgive me for the N00b questions.
However trying to get my head around this:
uint32_t time;
void SysTick_IntHandler(void)
{
time++;
}
int main(){
SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL| SYSCTL_OSC_INT);
uint32_t clock=SysCtlClockGet();
SysTickIntRegister(SysTick_IntHandler);
SysTickPeriodSet(SysCtlClockGet());
IntMasterEnable();
SysTickIntEnable();
SysTickEnable();
SysCtlDelay(SysCtlClockGet()/3); //approx 1 sec
SysTickDisable();
}
When running this code I don't get a count of 1 in time..
I get around 6.
Would this be because systick runs off pll?
If I run it with SYSCTL_USE_OSC I get a count of 1. However the chip then runs at around 5Mhz.
I guess I'm trying to get a constant count of 1sec for timer apps but I would like to run the processor a bit quicker than 5Mhz. Any ideas?
I have thoroughly read the datasheets and gone through all of the example code that I can find but I can't seem to get my head around some of this.
Thanks in advance.
Warwick