Joe Kissell

Trouble with delay

Discussion created by Joe Kissell on Jun 2, 2011
Latest reply on Jun 3, 2011 by Joe Kissell

I'm using the True-Time Simulator & Real Time Debugger Ver. 6.1 Build 9279.

 

For some reason, my code keeps breaking in this function on the while loop.

void delay_ms(unsigned short time){   //max delay time should be 65.535 seconds    unsigned long count;        //enable_timer2_interrupt();    t2Count = 0;        set_timer_delay(&count);    while(!timer_expired_delay(count, time)){;}    //if(startTCPIPflash==FALSE)    //    DISABLE_INT_TIMER2;    }

Please help me figure out what to look for to fix this problem.

It's odd because it works immediatly after initialization, but then a short while later, my 1ms timer interrupts and trys to write data to an LCD. That function calls this delay_ms() function and fails.

Outcomes