kgavionics
Full Member level 3
- Joined
- Jun 12, 2012
- Messages
- 167
- Helped
- 7
- Reputation
- 14
- Reaction score
- 11
- Trophy points
- 1,298
- Location
- Alberta.Canada
- Activity points
- 2,481
Hi guys
I switched to PIC18F family and i'm enjoying very much this family,it has a lot of advantages over PIC16F family.
I wrote a simple program in assembly to display string on LCD:
the program is working, but there's a little issue, because there's no way to tell the LCD to write the first 16 chars on the first lines and to return to second line to write the remains chars using the command (0XC0 on HD44780).
Basically, can someone help me to write a function that count for 16 chars and display them on the first line and to write the remaining chars on the second line.i have a long solution by coping all string to RAM using indirect mode and then declare a counter to count chars,but i want to see if i can do it simpler than this.
thank you in advance
I switched to PIC18F family and i'm enjoying very much this family,it has a lot of advantages over PIC16F family.
I wrote a simple program in assembly to display string on LCD:
Code:
;============================================================
MOVLW 0X0
MOVWF TBLPTRL ; LOOK UP TABLE LOW BYTE ADRESS
MOVLW 0X02
MOVWF TBLPTRH ; LOOK UP TABLE HIGH BYTE ADRESS
B7 TBLRD* ;TABLAT POINT TOWARD THE FIRST STRING
MOVF TABLAT,W ; COPY CHAR TO W
BZ EXIT
CALL dataw ;dataw is the function to send chars to LCD
INCF TBLPTRL,F
BRA B7
EXIT GOTO EXIT
ORG 0X200
MYDATA DB "DISPLAY A STRING OF CHARS ON MY LCD*** BY Kgavionics**** " ,0
END
;============================================================
end ; END OF PROGRAM
;============================================================
the program is working, but there's a little issue, because there's no way to tell the LCD to write the first 16 chars on the first lines and to return to second line to write the remains chars using the command (0XC0 on HD44780).
Basically, can someone help me to write a function that count for 16 chars and display them on the first line and to write the remaining chars on the second line.i have a long solution by coping all string to RAM using indirect mode and then declare a counter to count chars,but i want to see if i can do it simpler than this.
thank you in advance