Hello BConf,
I three places you have code similar to the following -
err = LCD_SendBlock( "Paso 1", 6, &SND);
while (err != ERR_OK);
Unless the value ERR_OK is immediately returned by the LCD_SendBlock() function, you will enter a wait loop. Since err is a local variable, once entered the wait loop can never exit.
Even if you had intended that the variable be global, and the value updated within another ISR, this also seems problematic. Assuming your posted code actually represents ISR code for a timer interrupt, further interrupts will be globally disabled by default (to prevent multiple nested interrupts). Again, the value of the variable could not change to exit the loop.
Rule #1: Never place wait loops, or even delay loops, within ISR code - always exit an ISR as quickly as possible.
Rule #2: Be wary about calling other functions from within an ISR - the called functions might contain wait loops or delay loops.
Under simulation conditions, it is possible that the value of err was such that the loop did not.
Regards,
Mac
Message Edited by bigmac on
2008-09-25 12:56 AM