#3 - LCD (2x16 Karakter) Uygulaması

<<PICxoid - Simulation Board>> indirmek için tıklayınız.

Uygulamaya ait kodları indirmek için tıklayınız.

 

LCD TANIMLAMALARI

  • #define LCD_RS      LATE0      //LCD_RS pini RE0'a bagli
  • #define LCD_E         LATE1      //LCD_E pini RE1'e bagli
  • #define LCD_D4      LATD7      //LCD_D4 pini RD7'ye bagli
  • #define LCD_D5      LATD6      //LCD_D5 pini RD6'ya bagli
  • #define LCD_D6      LATD5      //LCD_D6 pini RD5'e bagli
  • #define LCD_D7      LATD4      //LCD_D7 pini RD4'e bagli

 

LCD FONKSİYONLARI

  • LCD_Ayarla();
  • LCD_KomutGonder(char komut);
  • LCD_VeriGonder(char veri);
  • LCD_Temizle();
  • LCD_MetinYaz(char satir, char sutun, char *metin);
  • LCD_GotoXY(char satir, char sutun);

 

 

MAIN.C - YAZILAN KODLAR

void main(void)
{
    // Initialize the device
    SYSTEM_Initialize();

    // If using interrupts in PIC18 High/Low Priority Mode you need to enable the Global High and Low Interrupts
    // If using interrupts in PIC Mid-Range Compatibility Mode you need to enable the Global and Peripheral Interrupts
    // Use the following macros to:

    // Enable the Global Interrupts
    //INTERRUPT_GlobalInterruptEnable();

    // Disable the Global Interrupts
    //INTERRUPT_GlobalInterruptDisable();

    // Enable the Peripheral Interrupts
    //INTERRUPT_PeripheralInterruptEnable();

    // Disable the Peripheral Interrupts
    //INTERRUPT_PeripheralInterruptDisable();

    LCD_Ayarla();
    
    LCD_MetinYaz(1,1,"PICxoid");
    LCD_MetinYaz(2,1,"LCD Uygulamasi");
    DELAY_milliseconds(1000);
    
    while (1)
    {
        // Add your application code
        if (BUTON1_GetValue() == 0) {   //Butona basildi
            LCD_MetinYaz(2,1,"BUTON1'e basildi");
        } else {
            LCD_MetinYaz(2,1,"butona basilmadi");
        }

    }
}

UYGULAMAYA AİT DEVRE ŞEMASI

led_uygulamaasi_sema