moving message on LCD using PIC microcontroller 16f84
by Ivan
‘****************************************************************
‘* Name : LCD scrolling text.BAS *
‘* Author : [Dr.Rana] *
‘* Date : 8/25/2011 *
‘* Version : 1.0 *
‘* Notes : Moveing message on LCD 16 character 2 line *
‘* : *
‘****************************************************************
Device 16F84A
Declare LCD_Interface 4
‘ 4-line or 8-line interface is required by the LCD.
Declare LCD_Lines 4
‘ Inform the compiler as to how many lines the LCD has
Dim SCROL As Word
‘ this viarable is for indexing the characters on LCD
Dim ASCII As Byte
‘ second index variable for LCD locations
Dim CHAR1 As Byte
‘temparary variable in RAM
PORTB=0
PORTA=0
DelayMS 500
‘ to stabilized microcontroller
PRINT_MESSAGE_LCD_scrol:
For SCROL= 0 To 800
Cursor 1,1
For ASCII=0 To 15
‘ 0 TO 16 MAKES A TOTAL OF 16 LOCATION IN THE LCD (FOR LCD = 16 CHARS)
CHAR1 = LRead TEXT1 + (ASCII+ SCROL)
‘ Read memory location LABEL + LOOP
Print CHAR1
Next ASCII
Cursor 2,1
For ASCII=0 To 15
‘ 0 TO 16 MAKES A TOTAL OF 16 LOCATION IN THE LCD (FOR LCD = 16 CHARS)
CHAR1 = LRead TEXT2 + (ASCII+ SCROL)
‘ Read memory location LABEL + LOOP
Print CHAR1
Next ASCII
DelayMS 250
‘ DELAY IN ORDER TO SEE THE TEXT IN THE LCD
Next SCROL
GoTo PRINT_MESSAGE_LCD_scrol
TEXT1:
LData ” This is moving message example on LCD, the text will be scrol from right to left on LCD at first line “
TEXT2:
LData ” This example is written in IC BASIC Proton. and two line scroling is being performed here”
GoTo PRINT_MESSAGE_LCD_scrol
This program is tested in proteus ISIS and works fine.
The crystal frequency for microcontroller PIC 16f84 is 4MHz.
The text is scroll from right to left at both lines of LCD.
The user can change their own message in the program and recompile the basic code to hex file. Then using suitable programmer for PIC16f84 and burn the hex file of moving message display into the microcontroller.
Hello, thanks for your code. but when I simulate this with Proteus Isis, it gives a error message
“0×0053 stack overflow executing call instruction, 0x007E stack underflow executing return operation ” again and again. after some time simulating speed become very slow and almost stop. What should I do to that?