непонятным образом меняется регистр DDR ATmega128, программа написана на C от IAR - ставлю запрет всех глобальных прерываний
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено bookevg 30 апреля 2004 г. 16:21

/*-------------------------------------------------------------------------------
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