|
// Инициализация WX1602A
WritePort_IO(PORTD,0x80,0x80); // Выдача POR
delay(1);
WritePort_IO(PORTD,0x00,0x80);
delay(5);
Start_TWI(); // Старт I2C
MasterPutChar_TWI(0x76); // Адрес индикатора
MasterPutChar_TWI(0x00);
MasterPutChar_TWI(0x34);
MasterPutChar_TWI(0x0C);
MasterPutChar_TWI(0x06);
MasterPutChar_TWI(0x35);
MasterPutChar_TWI(0x02);
MasterPutChar_TWI(0x04);
MasterPutChar_TWI(0x08);
MasterPutChar_TWI(0x40);
MasterPutChar_TWI(0x9E); // Конец инициализации индикатора
Stop_TWI();
// Должен появиться растр. Дальше можно выдавать символы...
P.S. Не пренебрегайте POR! Я сначала делал его от кнопки и индикатор не хотел заводиться. Как только завел reset от контроллера - все задышало.
E-mail: info@telesys.ru