I am a beginner to embedded programming. I am facing issues on creating delay using TM4C129 timer, could someone help me to troubleshoot the issue? . The IDE used is keiluV5 and the code build process is successful. I am writing a toggling value to GPIO with the provided delay in the function (1ms, 10ms etc ) (The GPIO is monitored in oscilloscope with same code without 'while(DelaySet_Flag); ' and calling the function before the begin of wait while() of main code; there the timer is working fine) . The same code is not working inside the wait while at the end of main code.
Please find the code below
Thanks
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
void Delay(uint32_t Delay_value)
{
uint32_t Timer_Count;
Timer_Count = (120000 * Delay_value); // Count calcultion for value in milli sec
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER3);
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_TIMER3)){}
ROM_TimerConfigure(TIMER3_BASE, TIMER_CFG_PERIODIC);
ROM_TimerLoadSet(TIMER3_BASE, TIMER_A, g_ui32SysClock); // 120Mhz
ROM_IntEnable(INT_TIMER3A);
ROM_TimerIntEnable(TIMER3_BASE, TIMER_TIMA_TIMEOUT);
ROM_TimerLoadSet(TIMER3_BASE, INT_TIMER3A, Timer_Count);
ROM_TimerEnable(TIMER3_BASE, TIMER_A);
DelaySet_Flag=0x01;
while(DelaySet_Flag); // DelaySet_Flag=0x00 in intrrupt handler, DelaySet flag is a global variable
DelaySet_Flag=0x01;
}