/******************************************************* This program was created by the CodeWizardAVR V3.24 Automatic Program Generator © Copyright 1998-2015 Pavel Haiduc, HP InfoTech s.r.l. http://www.hpinfotech.com Project : Version : Date : 21.02.2016 Author : Company : Comments: Chip type : ATmega8 Program type : Application AVR Core Clock frequency: 4,000000 MHz Memory model : Small External RAM size : 0 Data Stack size : 256 *******************************************************/ #include char hour=0,min=0,sek=0,day=0,month=0,year=0,week_day=0; bit time_flag=0; // Bit-Banged I2C Bus functions #include // DS1307 Real Time Clock functions #include // Alphanumeric LCD functions #include // Declare your global variables here // External Interrupt 1 service routine interrupt [EXT_INT1] void ext_int1_isr(void) { time_flag=1; } void show_time() { rtc_get_time(&hour,&min,&sek); rtc_get_date(&week_day,&day,&month,&year); lcd_gotoxy(0,0); lcd_putchar(hour/10+0x30); lcd_putchar(hour%10+0x30); lcd_putchar(':'); lcd_putchar(min/10+0x30); lcd_putchar(min%10+0x30); lcd_putchar(':'); lcd_putchar(sek/10+0x30); lcd_putchar(sek%10+0x30); lcd_gotoxy(0,1); lcd_putchar(day/10+0x30); lcd_putchar(day%10+0x30); lcd_putchar('/'); lcd_putchar(month/10+0x30); lcd_putchar(month%10+0x30); lcd_putchar('/'); lcd_putchar(year/10+0x30); lcd_putchar(year%10+0x30); time_flag=0; } void main(void) { // Declare your local variables here // Input/Output Ports initialization // Port B initialization // Function: Bit7=In Bit6=In Bit5=In Bit4=In Bit3=In Bit2=In Bit1=In Bit0=In DDRB=(0<