Atm8 NonRTC Clock Code

download Atm8 NonRTC Clock Code

If you can't read please download the document

description

Line program Mikrokontroller untuk jam non-RTC.

Transcript of Atm8 NonRTC Clock Code

/*****************************************************This program was produced by theCodeWizardAVR V2.05.3 StandardAutomatic Program Generator Copyright 1998-2011 Pavel Haiduc, HP InfoTech s.r.l.http://www.hpinfotech.comProject : Version : Date : 13/01/2015Author : Donny TappyCompany : STTPLNComments: Chip type : ATmega8Program type : ApplicationAVR Core Clock frequency: 12,000000 MHzMemory model : SmallExternal RAM size : 0Data Stack size : 256*****************************************************/unsigned char temp[6];int detik=0, menit=0, jam=12, indeks=6;#include #include #include // Alphanumeric LCD functions#include // Timer1 overflow interrupt service routineinterrupt [TIM1_OVF] void timer1_ovf_isr(void){// Reinitialize Timer1 valueTCNT1H=0xD23A >> 8;TCNT1L=0xD23A & 0xff;detik++;}void jam_digital(){if (detik==60) { lcd_clear(); detik=0; menit++; } if (menit==60) { lcd_clear(); menit=0; jam++; } if (jam==24) { lcd_clear(); jam=0; } }void tampil_lcd(){ lcd_gotoxy(0,0); lcd_putsf("Ely Tappi"); itoa(jam,temp); //menampilkan JAM di LCD lcd_gotoxy(4,1); lcd_puts(temp); itoa(detik,temp); //menampilkan DETIK di LCD lcd_gotoxy(10,1); lcd_puts(temp); lcd_gotoxy(9,1); //menampilkan : lcd_putsf(":"); itoa(menit,temp); //menampilkan MENIT di LCD lcd_gotoxy(7,1); lcd_puts(temp); lcd_gotoxy(6,1); //menampilkan : lcd_putsf(":"); lcd_gotoxy(1,1); //menampilkan =24) { jam=23; } } if (PINB.2==0) { delay_ms(300); jam=jam-10; if (jam