#include #include void LCD_command(unsigned char command) { PORTB = command; PORTG = 0x04; _delay_us(1); PORTG = 0x00; _delay_us(5); } void LCD_data(unsigned char data) { PORTB = data; PORTG = 0x05; _delay_us(1); PORTG = 0x01; _delay_us(5); } void LCD_string(unsigned char command, unsigned char *string) { LCD_command(command); while(*string != '\0') { LCD_data(*string); string++; } } void LCD_initialize(void) { DDRB = 0xFF; DDRG = 0xFF; _delay_ms(20); LCD_command(0x38); LCD_command(0x08); LCD_command(0x01); _delay_ms(2); LCD_command(0x06); LCD_command(0x0E); } int main(void) { LCD_initialize(); while(1) { LCD_string(0x80,"ATmega128 Simul"); LCD_string(0xC0,"* DICE of HSU *"); _delay_ms(200); } }