Author Topic: Nokia LCD problem  (Read 2341 times)

0 Members and 1 Guest are viewing this topic.

Offline LesterwyattTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: gb
    • My YouTube Channel
Nokia LCD problem
« on: January 01, 2015, 09:07:07 pm »
Hello.

 I have interfaced a pic18f and RTC to a  nokia to a 5110 graphical lcd.
However i am having a few problems, i am using a lookup table to display the time using RETLW. (see below)
My problem is when the table is called from the BCD value, its only calling and displaying 1 byte rather than 6 byts i.e.

BCD value (00000001) 1.
calls table and dissplays 0X00
rather than  0x00 0x00 0x42 0x7f 0x40 0x00

anybody know what im missing?
 
Part of my code I am using for the Nokia 5110 lcd.

6 byte value to display the number '1' on nokia lcd
addwf PCL,f
retlw 0x00    //6 byte character map
retlw 0x00
retlw 0x42
retlw 0x7F
retlw 0x40
retlw 0x00 

Thanks Lester
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 2275
  • Country: ca
Re: Nokia LCD problem
« Reply #1 on: January 02, 2015, 01:17:43 am »
A lookup table like you implemented will return a single value based on the passed in value of W. For your table, if you call the lookup table with W set to 2, it will return 0x42 (in W). If W is set to 3, then it will return 0x7F. You won't get 6 values unless you call the table 6 times.
Does that help?
 

Offline LesterwyattTopic starter

  • Regular Contributor
  • *
  • Posts: 73
  • Country: gb
    • My YouTube Channel
Re: Nokia LCD problem
« Reply #2 on: January 02, 2015, 02:03:48 am »
Yes I understand, hmm wonder if I could put a value of 6 in a tmp register and have a decfsz  and on every pass add 1 to bcd value? this way it would decrement down the retlw table based on the first received byte?
 i.e. received byte is 00000001. and adding 1 would be 00000010....

lester
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf