LAMPIRAN A RANGKAIAN

                LCD

A-1

Port   ekspansi

LAMPIRAN B PROGRAM

 

/*****************************************************  This program was produced by the  CodeWizardAVR V1.25.3 Professional  Automatic Program Generator  © Copyright 1998‐2007 Pavel Haiduc, HP InfoTech s.r.l.  http://www.hpinfotech.com    Project :   Version :   Date    : 11/25/2009  Author  : Edwin                             Company : Bonzo                             Comments:     Chip type           : ATmega16  Program type        : Application  Clock frequency     : 16.000000 MHz  Memory model        : Small  External SRAM size  : 0  Data Stack size     : 256  *****************************************************/  #include   #include   #include     // Alphanumeric LCD Module functions  #asm     .equ __lcd_port=0x15 ;PORTC  #endasm  #include     int del;    #define PORT PORTD  #define d3 PORT.0  #define d2 PORT.1  #define d1 PORT.2  #define d0 PORT.3  #define wr PORT.7  #define cs PORT.6  #define rs0 PORT.5  #define rd PORT.4  #define delay delay_ms(del)     #define telkomsel 0x00   #define indosat 0x04  #define xl 0x08  #define axis 0x0C  #define three 0x10  #define cdma_roaming 0x14 

B-1   

 

#define cdma_lokal 0x18  #define tlp_rmh 0x1C     // Declare your global variables here    char text[30];  char keypressed;   char no_tlp[12]  ;   int i,j,k;  int dial[12],cal_tone,hitung;      void no_line(void)  {lcd_clear();  lcd_putsf("Maaf, Saluran");  lcd_gotoxy(0,1);  lcd_putsf("tidak terhubung");  delay_ms(3000);  i=0; no_tlp[0]=' ';no_tlp[1]=' ';no_tlp[2]=' ';no_tlp[3]=' ';no_tlp[4]=' ';no_tlp[5]='  ';no_tlp[6]=' ';no_tlp[7]=' ';no_tlp[8]=' ';no_tlp[9]=' ';no_tlp[10]=' ';no_tlp[11]=' ';  dial[0]=0;dial[1]=0;dial[2]=0;dial[3]=0;dial[4]=0;dial[5]=0;dial[6]=0;dial[7]=0;dial[8]=0;dia l[9]=0;dial[10]=0;dial[11]=0;k=0;  }    void out (char output)  {  DDRD=255;  wr=1;rd=1;rs0=1;cs=0;    if(output==1)  {d0=1;d1=0;d2=0;d3=1;}  else  {d0=0;d1=0;d2=0;d3=1;}    wr=0;  delay_us(1);  wr=1;  delay_us(1);    if(output==1)  {d0=1;d1=0;d2=0;d3=0;}  else  {d0=0;d1=0;d2=0;d3=0;}    wr=0;  delay_us(1);  wr=1;  delay_us(1);    }   

B-2   

 

void dtmf (char input)  {      DDRD=0xFF;    rd=1;    wr=1;    cs=0;    rs0=0;    delay_us(1);        switch(input)    {    case 1:  d3=0;d2=0;d1=0;d0=1;break;    case 2:  d3=0;d2=0;d1=1;d0=0;break;    case 3:  d3=0;d2=0;d1=1;d0=1;break;                            case 4:  d3=0;d2=1;d1=0;d0=0;break;    case 5:  d3=0;d2=1;d1=0;d0=1;break;    case 6:  d3=0;d2=1;d1=1;d0=0;break;    case 7:  d3=0;d2=1;d1=1;d0=1;break;    case 8:  d3=1;d2=0;d1=0;d0=0;break;    case 9:  d3=1;d2=0;d1=0;d0=1;break;    case 0:  d3=1;d2=0;d1=1;d0=0;break;    case '*':d3=1;d2=0;d1=1;d0=1;break;    case '#':d3=1;d2=1;d1=0;d0=0;break;    case 'a':d3=1;d2=1;d1=0;d0=1;break;    case 'b':d3=1;d2=1;d1=1;d0=0;break;    case 'c':d3=1;d2=1;d1=1;d0=1;break;    case 'd':d3=0;d2=0;d1=0;d0=0;break;    }        wr=0;    delay_us(1);    wr=1;    delay_us(1);      }    void tone (void)  {  cal_tone=0;  hitung=0;  DDRA.1=0;  PORTA.1=1;    periksa1:  if (PINA.1==0)  goto periksa2;  goto periksa1;    periksa2:  if (PINA.1==1) 

B-3   

 

{hitung=0;  goto periksa3;}  else  {hitung=hitung+1;  delay_us(1);  if (hitung