Hello everyone.
I was wondering if anyone could help me or point me in the right direction.
I have implemented a lookup table for my Nokia LCD project. The lookup table consists of bitmap data (7 byte for each character 'see below'). what I was hoping to do, is select and display a character based on a BCD value. So for instance; if I had a unpacked BCD value of 00000010 this value would select entry number '2' in my table data, and return it to the LCD display. As it stands, what ever value I throw at my table it displays all of the data from my table on the LCD .i.e. 1234567890.
My project is based on the pic18f46k20/ds1306 RTC. I am hoping to display the time and date on the LCD.
Many thanks Lester
Part of my code below:
NEXT movlw high MY_DATA ; load font1 H address to tbptrH
movwf TBLPTRH
movlw upper MY_DATA ; load font1 U address
movwf TBLPTRU
movlw low MY_DATA ; load font1 L address to tbptrL
movwf TBLPTRL
movf TEMP ,W
addwf TBLPTRL
tblrd *+ ;read table entry into TABLAT
movf TABLAT,w ;in WREG
call SPI ; get data and write out
incf TEMP
MOVLW -.2
CPFSEQ TEMP
goto NEXT
RETURN
ORG 0x500
MY_DATA
db 0x3E,0x7F,0x71,0x59,0x4D,0x7F,0x3E,0 ; '0'
db 0x40,0x42,0x7F,0x7F,0x40,0x40,0x00,0 ; '1'
db 0x62,0x73,0x59,0x49,0x6F,0x66,0x00,0 ; '2'
db 0x22,0x63,0x49,0x49,0x7F,0x36,0x00,0 ; '3'
db 0x18,0x1C,0x16,0x53,0x7F,0x7F,0x50,0 ; '4'
db 0x27,0x67,0x45,0x45,0x7D,0x39,0x00,0 ; '5'
db 0x3C,0x7E,0x4B,0x49,0x79,0x30,0x00,0 ; '6'
db 0x03,0x03,0x71,0x79,0x0F,0x07,0x00,0 ; '7'
db 0x36,0x7F,0x49,0x49,0x7F,0x36,0x00,0 ; '8'
db 0x06,0x4F,0x49,0x69,0x3F,0x1E,0x00,0 ; '9'
END