this : TimerPrescaleSet (TIMER0_BASE, TIMER_A , TIMER_PRESCALER );
it was gave the same result when comment the previous function or when not comment it ?!!
I want to using pre scaler but I don't understand where is the problem
#define TIMER_PRESCALER 64
void Timer0_ISR (void)
{
static volatile uint8_t ui8LED = 2;
static volatile uint16_t counter = 0;
// Clear the timer interrupt.
TimerIntClear(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
if (counter == 1000 )
{
GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, ui8LED);
if (ui8LED == 8) { ui8LED = 2 ; } else { ui8LED = ui8LED * 2; }
counter = 0;
}
else
{
counter++;
}
}
int main(void) {
//80MHZ
SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
SysCtlDelay(5);
TimerConfigure(TIMER0_BASE, TIMER_CFG_A_PERIODIC);
TimerLoadSet(TIMER0_BASE, TIMER_A, (SysCtlClockGet())/1000 );
TimerPrescaleSet (TIMER0_BASE, TIMER_A , TIMER_PRESCALER );
TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
IntEnable(INT_TIMER0A);
IntMasterEnable();
TimerEnable(TIMER0_BASE, TIMER_A);
while (1)
{
}
}