0% found this document useful (0 votes)
5 views3 pages

LCD Control Program for PIC16F877A

This document is a code for a PIC microcontroller (16F877A) that initializes and controls an LCD display. It includes routines for sending commands and data to the LCD, as well as a delay function. The program sets up the necessary ports and configurations for proper operation of the LCD.

Uploaded by

ManojChowdary
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

LCD Control Program for PIC16F877A

This document is a code for a PIC microcontroller (16F877A) that initializes and controls an LCD display. It includes routines for sending commands and data to the LCD, as well as a delay function. The program sets up the necessary ports and configurations for proper operation of the LCD.

Uploaded by

ManojChowdary
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

listp=16f877a

#include<[Link]>

ORG0X000
GOTORESET

;RESETADDRESS

ORG0X007
RESET
BSFSTATUS,RP0
BCFSTATUS,RP1
BSFPCON,0
BSFPCON,1
GOTOSTART

;NOWINBANK1

ORG0X20
START
CALLINITIALISATION
BCFPORTC,0;DATAONPORTDISTAKENASCOMMAND
FORLCD
MOVLW0X3F
CALLSEND
MOVLW0X0E
CALLSEND

;DISPLAYON,CURSERBLINKING

MOVLW0X01
CALLSEND

;DISPLAYCLEAR

MOVLW0X80
;SETDDRAMADDRESSAS0X00H,
MEANSPUTCURSERATFIRSTLINE
CALLSEND
BSFPORTE,0
DATA
MOVLW0X07
CALLLCDDELAY
CALLLCDDELAY
MOVLW'H'

;DATAONPORTDISTAKENAS

CALLSEND
MOVLW'E'
CALLSEND
OVER
GOTOOVER

INITIALISATION:
BCFSTATUS,RP0
;BANK0
CLRFPORTD
;PORTBASDATAPINS
CLRFPORTE
;PROTEASCONTROLPINS
BSFSTATUS,RP0
;BANK1
MOVLW0X00
MOVWFTRISD
;PORTBOUTPUT
MOVWFTRISE
MOVLW0X86
;PORTSPINCONFIG
MOVWFADCON1
NOP
BCFSTATUS,RP0
;BANK0
MOVLW0XFF
MOVWFPORTD
CALLLCDDELAY
CALLLCDDELAY ;POWERUPDELAYOF67msec
RETURN

SEND:
MOVWFPORTD
NOP
BSFPORTE,2
NOP
NOP
NOP
BCFPORTE,2
MOVLW0XA3
CALLLCDDELAY
CALLLCDDELAY
RETURN

LCDDELAY
MOVWF0X25

;600nSdelay

NEST1
MOVLW0XFF
MOVWF0X27
NEST2
DECFSZ0X27
GOTONEST2
DECFSZ0X25
GOTONEST1
RETURN
END

You might also like