Mình đã làm được việc hiển thị ký thự phi lên LCD 16x2 rồi. Xin post CODE lên đây để làm tài liệu tham khảo cho những người đi sau. Đầu tiên là các công việc phải làm :
1. Vẽ chữ phi :xem file attach.
2. Xác định giá trị và thứ tự các byte để out ra cổng hiển thị LCD. Theo như hình vẽ thì giá trị các byte sẽ là :
Byte0 0x13
Byte1 0x15
Byte2 0x15
Byte3 0x0E
Byte4 0x04
Byte5 0x04
Byte6 0x04
Byte7 0x00
3. Viết chương trình
Code:
WriteCGChar:
movlw 0x40
call WriteCommand ; Put the Cursor to the Start of CGRAM
CharLoop:
call CGChar
call WriteData ; Output the ASCII Character
incf Count,1 ; Do 8x
movlw .8
xorwf Count,0
btfss STATUS,Z
goto CharLoop
movlw 0x80 ;Move the Cursor Back into LCD Memory Space
call WriteCommand
movlw .0 ; Display the Character
call WriteData
return
CGChar:
movf Count,0
addwf PCL,1
retlw 0x13
retlw 0x15
retlw 0x15
retlw 0x0E
retlw 0x04
retlw 0x04
retlw 0x04
retlw 0x00