Hi everyone,
I met some difficult in Timer configuration of EK-TM4C1294. I want to set a timer interrupt with 1ms.
I read many documentaries on the internet, however, I could not understand fully about PresscaleSet.
I have not oscilloscope to check so please help me with this.
Here is my stupid code:
SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_320), 40000000);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);
GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE,led1|led2);
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
TimerDisable(TIMER0_BASE,TIMER_A);
TimerConfigure(TIMER0_BASE,TIMER_CFG_SPLIT_PAIR|TIMER_CFG_PERIODIC_UP);
TimerPrescaleSet(TIMER0_BASE,TIMER_A,8-1);
int period = 5000;
TimerLoadSet(TIMER0_BASE,TIMER_A,period-1);
IntEnable(INT_TIMER0A);
TimerIntEnable(TIMER0_BASE,TIMER_TIMA_TIMEOUT);
IntMasterEnable();
TimerEnable(TIMER0_BASE,TIMER_A);
Please give me the equation to change 'period' to 'real time' with presscale and without presscale.
Regard,
Phu