LCD Hello World Display demo

Demo code for LCD display to print Hello World Text in Bootloader USB PIC18F4550 by 4-bit method LCD interface.

Compiler : Microchip C18 C Compiler

Kit : Bootloader USB PIC18F4550

Project : LCD interface 4-bit method


LCD Details

LCD Hardware circuit

lcd circuit

LCD project output

lcd display

Source code:


#include < p18F4550.h>
#include < delays.h>                       ;Delay Header file
#include "bootlcd.h"                        ;Lcd Header file

void low_isr(void);
void high_isr(void);

#pragma code low_vector=0x2018
void interrupt_at_low_vector(void)
{
  _asm GOTO low_isr _endasm
}
#pragma code 

#pragma code high_vector=0x2008
void interrupt_at_high_vector(void)
{
  _asm GOTO high_isr _endasm
}
#pragma code 

#pragma interruptlow low_isr
void low_isr (void)
{
  
 return;
}

#pragma interrupt high_isr
void high_isr (void)
{
 return;
}


void DelayFor18TCY( void )
{
 Delay10TCYx(2);        // 5us delay
 return;
}
void DelayPORXLCD (void)
{
  Delay1KTCYx(75); // Delay of 15ms
                   // Cycles = (TimeDelay * Fosc) / 4
                   // Cycles = (15ms * 20MHz) / 4
                   // Cycles = 75,000
  return;
}
void DelayXLCD (void)
{
  Delay1KTCYx(25); // Delay of 5ms
                   // Cycles = (TimeDelay * Fosc) / 4
                   // Cycles = (5ms * 20MHz) / 4
                   // Cycles = 25,000
  return;
}
void main( void )
{
   
  OpenXLCD();     // configure external LCD

  putrsXLCD("Hello world !");

  while(1)
  {
    ;
  }

}


Bootlcd.h details



User Comments

No Posts found !

Login to Post a Comment.