In this project you will write a program that displays a long message on the 2X1
ID: 3655170 • Letter: I
Question
In this project you will write a program that displays a long message on the 2X16 LCD on the trainer board. In order to show a message that is longer than 16 characters you need to scroll the display. So you will show a part of message and then move characters to the left to show the rest of message. You will need a delay routine to display part of message at a time. I want to start this off by building a flowchart. Any help would be appreciated. The message I was thinking of implementing is "Hello Everyone. Goodbye Everyone."Explanation / Answer
LCDINIT MACRO BANK1 CLRF LCDDSPORT ;LCDdsport where LCD is an output BANKO CALL DELAY1MS CALL DELAY1MS CALL DELAY1MS CALL DELAY1MS ;4 ms pause MOVLW FUNCTSET8 ;Begin initialization in CALL SENDW ;8-bit mode CALL DELAY1MS CALL DELAY1MS ;2 ms pause MOVLW DDZERO ;Write 0 to DDRAM CALL SENDW MOVLW FUNCTSET4 ;From this line, LCD works in 4-bit mode CALL SENDW ;Commands for initializing LCD LCDCMD LCD2L LCDCMD LCDC0NT LCDCMD LCDSH ;lcd has 2 lines LCDCMD LCDCLR ;Clear LCD ENDM LCDCMD MACRO LCDCOMMAND MOVLW LCDCOMMAND CALL LCDCOMD ENDM LCDCLR MACRO MOVLW LCDCLR CALL LCDCOMD ENDM LCD_DDADR MACRO DDRAMADDRESS LOCAL VALUE = DDRAMADDEESS | 0x80;DDRAH starting address MOVLW VALUE CALL LCDCOMD ENDM LCDCOMD CLRF LCDBUF GOTO LCDWR LCDDATA CLRF LCDBUF BSF LCDBUF ,RS LCDWR MOVWF LCDTEMP ANDLW B'11110000' IORWF LCDBUF ,W CALL SENDW SWAPF LCDTEMP,W ANDLW B'11110000' IORWF LCDBUF,W CALL SENDW RETURN
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.