|
/*-------------------------------------------------------------------------------
Wait as long as the LCD is busy
LcdWaitBusy();
-------------------------------------------------------------------------------*/
void LcdWaitBusy (void)
{
__disable_interrupt();
PORT_LCD_DATA = 0xB0; /* set LCD_DATA port in input mode */
DDR_LCD_DATA = 0x4F; /* set LCD_DATA port in input and output mode */
LCD_DI = 0; /* Instruction mode */
LCD_RW = 1; /* Read mode */
LCD_E = 0; /* strobe */
__no_operation();
__no_operation();
__no_operation();
__no_operation();
LCD_E = 1;
__no_operation();
__no_operation();
__no_operation();
__no_operation();
while ( tstBit(PIN_LCD_DATA,7 ))//; /* mask the other status bits and test the BUSY bit */
{
if ( DDR_LCD_DATA != 0x4f )
{
__no_operation(); // попадаю сюда
DDR_LCD_DATA = 0x4F;
}
}
LCD_E = 0;
PORT_LCD_DATA = 0x00; /* set LCD_DATA port in input mode */
DDR_LCD_DATA = 0xFF; /* set LCD_DATA port in output mode */
__enable_interrupt();
}
E-mail: info@telesys.ru