Using Nokia LCD


Closed Thread
Results 1 to 40 of 301

Thread: Using Nokia LCD

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    I found that I could add up to 6 more characters (30 more bytes) to your code without getting the same error. I don't know exactly why you are getting the stack overflow errors, but the eeprom space is very limited. Since you have so much more space with the 648a, you might think about storing all the character data in program memory. You would need to modify your code a little bit though. You can edit out the characters that you don't need to save a little space.

    Code:
    FC var byte [5]
    Lcd_data var byte ' example Lcd_data = "I", gosub Lcd_SendChar , this will print the character "I"
    
    Lcd_SendChar:
        lookdown Lcd_data,[" !\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"],CharNum'[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"],CharNum
        Lcd_data = CharNum +32   
        sELECT CASE lcd_data
        Case 32                   
        	FC(0)=$00:FC(1)=$00:FC(2)=$00:FC(3)=$00:FC(4)=$00 ' // sp
        Case 33                   
        	FC(0)=$00:FC(1)=$00:FC(2)=$2f:FC(3)=$00:FC(4)=$00 ' // !
        Case 34                   
        	FC(0)=$00:FC(1)=$07:FC(2)=$00:FC(3)=$07:FC(4)=$00 ' // " (use \)
        Case 35                   
        	FC(0)=$14:FC(1)=$7f:FC(2)=$14:FC(3)=$7f:FC(4)=$14 ' // #
        Case 36                   
        	FC(0)=$24:FC(1)=$2a:FC(2)=$7f:FC(3)=$2a:FC(4)=$12 ' // $
        Case 37                   
        	FC(0)=$c4:FC(1)=$c8:FC(2)=$10:FC(3)=$26:FC(4)=$46 ' // %
        Case 38                   
        	FC(0)=$36:FC(1)=$49:FC(2)=$55:FC(3)=$22:FC(4)=$50 ' // &
        Case 39                   
        	FC(0)=$00:FC(1)=$05:FC(2)=$03:FC(3)=$00:FC(4)=$00 ' // '
        Case 40                   
        	FC(0)=$00:FC(1)=$1c:FC(2)=$22:FC(3)=$41:FC(4)=$00 ' // (
        Case 41                   
        	FC(0)=$00:FC(1)=$41:FC(2)=$22:FC(3)=$1c:FC(4)=$00 ' // )
        Case 42                   
        	FC(0)=$14:FC(1)=$08:FC(2)=$3E:FC(3)=$08:FC(4)=$14 ' // *
        Case 43                   
        	FC(0)=$08:FC(1)=$08:FC(2)=$3E:FC(3)=$08:FC(4)=$08 ' // +
        Case 44                   
        	FC(0)=$00:FC(1)=$00:FC(2)=$50:FC(3)=$30:FC(4)=$00 ' // 
        Case 45                   
        	FC(0)=$10:FC(1)=$10:FC(2)=$10:FC(3)=$10:FC(4)=$10 ' // -
        Case 46                   
        	FC(0)=$00:FC(1)=$60:FC(2)=$60:FC(3)=$00:FC(4)=$00 ' // .
        Case 47                   
        	FC(0)=$20:FC(1)=$10:FC(2)=$08:FC(3)=$04:FC(4)=$02 ' // /
        Case 48                   
        	FC(0)=$3E:FC(1)=$51:FC(2)=$49:FC(3)=$45:FC(4)=$3E ' // 0
        Case 49                   
        	FC(0)=$00:FC(1)=$42:FC(2)=$7F:FC(3)=$40:FC(4)=$00 ' // 1
        Case 50                   
        	FC(0)=$42:FC(1)=$61:FC(2)=$51:FC(3)=$49:FC(4)=$46 ' // 2
        Case 51                   
        	FC(0)=$21:FC(1)=$41:FC(2)=$45:FC(3)=$4B:FC(4)=$31 ' // 3
        Case 52                   
        	FC(0)=$18:FC(1)=$14:FC(2)=$12:FC(3)=$7F:FC(4)=$10 ' // 4
        Case 53                   
        	FC(0)=$27:FC(1)=$45:FC(2)=$45:FC(3)=$45:FC(4)=$39 ' // 5
        Case 54                   
        	FC(0)=$3C:FC(1)=$4A:FC(2)=$49:FC(3)=$49:FC(4)=$30 ' // 6
        Case 55                   
        	FC(0)=$01:FC(1)=$71:FC(2)=$09:FC(3)=$05:FC(4)=$03 ' // 7
        Case 56                   
        	FC(0)=$36:FC(1)=$49:FC(2)=$49:FC(3)=$49:FC(4)=$36 ' // 8
        Case 57                   
        	FC(0)=$06:FC(1)=$49:FC(2)=$49:FC(3)=$29:FC(4)=$1E ' // 9
        Case 58                   
        	FC(0)=$00:FC(1)=$36:FC(2)=$36:FC(3)=$00:FC(4)=$00 ' // :
        Case 59                   
        	FC(0)=$00:FC(1)=$56:FC(2)=$36:FC(3)=$00:FC(4)=$00 ' // ";"
        Case 60                   
        	FC(0)=$08:FC(1)=$14:FC(2)=$22:FC(3)=$41:FC(4)=$00 ' // <
        Case 61                   
        	FC(0)=$14:FC(1)=$14:FC(2)=$14:FC(3)=$14:FC(4)=$14 ' // =
        Case 62                   
        	FC(0)=$00:FC(1)=$41:FC(2)=$22:FC(3)=$14:FC(4)=$08 ' // >
        Case 63                   
        	FC(0)=$02:FC(1)=$01:FC(2)=$51:FC(3)=$09:FC(4)=$06 ' // ?
        Case 64                   
        	FC(0)=$32:FC(1)=$49:FC(2)=$59:FC(3)=$51:FC(4)=$3E ' // @
        Case 65                   
        	FC(0)=$7E:FC(1)=$11:FC(2)=$11:FC(3)=$11:FC(4)=$7E ' // A
        Case 66                   
        	FC(0)=$7F:FC(1)=$49:FC(2)=$49:FC(3)=$49:FC(4)=$36 ' // B
        Case 67                   
        	FC(0)=$3E:FC(1)=$41:FC(2)=$41:FC(3)=$41:FC(4)=$22 ' // C
        Case 68                   
        	FC(0)=$7F:FC(1)=$41:FC(2)=$41:FC(3)=$22:FC(4)=$1C ' // D
        Case 69                   
        	FC(0)=$7F:FC(1)=$49:FC(2)=$49:FC(3)=$49:FC(4)=$41 ' // E
        Case 70                   
        	FC(0)=$7F:FC(1)=$09:FC(2)=$09:FC(3)=$09:FC(4)=$01 ' // F
        Case 71                   
        	FC(0)=$3E:FC(1)=$41:FC(2)=$49:FC(3)=$49:FC(4)=$7A ' // G
        Case 72                   
        	FC(0)=$7F:FC(1)=$08:FC(2)=$08:FC(3)=$08:FC(4)=$7F ' // H
        Case 73                   
        	FC(0)=$00:FC(1)=$41:FC(2)=$7F:FC(3)=$41:FC(4)=$00 ' // I
        Case 74                   
        	FC(0)=$20:FC(1)=$40:FC(2)=$41:FC(3)=$3F:FC(4)=$01 ' // J
        Case 75                   
        	FC(0)=$7F:FC(1)=$08:FC(2)=$14:FC(3)=$22:FC(4)=$41 ' // K
        Case 76                   
        	FC(0)=$7F:FC(1)=$40:FC(2)=$40:FC(3)=$40:FC(4)=$40 ' // L
        Case 77                   
        	FC(0)=$7F:FC(1)=$02:FC(2)=$0C:FC(3)=$02:FC(4)=$7F ' // M
        Case 78                   
        	FC(0)=$7F:FC(1)=$04:FC(2)=$08:FC(3)=$10:FC(4)=$7F ' // N
        Case 79                   
        	FC(0)=$3E:FC(1)=$41:FC(2)=$41:FC(3)=$41:FC(4)=$3E ' // O
        Case 80                   
        	FC(0)=$7F:FC(1)=$09:FC(2)=$09:FC(3)=$09:FC(4)=$06 ' // P
        Case 81                   
        	FC(0)=$3E:FC(1)=$41:FC(2)=$51:FC(3)=$21:FC(4)=$5E ' // Q
        Case 82                   
        	FC(0)=$7F:FC(1)=$09:FC(2)=$19:FC(3)=$29:FC(4)=$46 ' // R
        Case 83                   
        	FC(0)=$46:FC(1)=$49:FC(2)=$49:FC(3)=$49:FC(4)=$31 ' // S
        Case 84                   
        	FC(0)=$01:FC(1)=$01:FC(2)=$7F:FC(3)=$01:FC(4)=$01 ' // T
        Case 85                   
        	FC(0)=$3F:FC(1)=$40:FC(2)=$40:FC(3)=$40:FC(4)=$3F ' // U
        Case 86                   
        	FC(0)=$1F:FC(1)=$20:FC(2)=$40:FC(3)=$20:FC(4)=$1F ' // V
        Case 87                   
        	FC(0)=$3F:FC(1)=$40:FC(2)=$38:FC(3)=$40:FC(4)=$3F ' // W
        Case 88                   
        	FC(0)=$63:FC(1)=$14:FC(2)=$08:FC(3)=$14:FC(4)=$63 ' // X
        Case 89                   
        	FC(0)=$07:FC(1)=$08:FC(2)=$70:FC(3)=$08:FC(4)=$07 ' // Y
        Case 90                   
        	FC(0)=$61:FC(1)=$51:FC(2)=$49:FC(3)=$45:FC(4)=$43 ' // Z
    '    Case 91                   
    '    	FC(0)=$00:FC(1)=$7F:FC(2)=$41:FC(3)=$41:FC(4)=$00 ' // [
    '    Case 92                   
    '        FC(0)=$02:FC(1)=$04:FC(2)=$08:FC(3)=$10:FC(4)=$20 ' // \  (we are using this for " above)
    '    Case 93                   
    '    	FC(0)=$00:FC(1)=$41:FC(2)=$41:FC(3)=$7F:FC(4)=$00 ' // ]
    '    Case 94                   
    '    	FC(0)=$04:FC(1)=$02:FC(2)=$01:FC(3)=$02:FC(4)=$04 ' // ^
    '    Case 95                   
    '    	FC(0)=$40:FC(1)=$40:FC(2)=$40:FC(3)=$40:FC(4)=$40 ' // _
    '    Case 96                   
    '    	FC(0)=$00:FC(1)=$01:FC(2)=$02:FC(3)=$04:FC(4)=$00 ' // '
    '    Case 97                   
    '    	FC(0)=$20:FC(1)=$54:FC(2)=$54:FC(3)=$54:FC(4)=$78 ' // a
    '    Case 98                   
    '    	FC(0)=$7F:FC(1)=$48:FC(2)=$44:FC(3)=$44:FC(4)=$38 ' // b
    '    Case 99                   
    '    	FC(0)=$38:FC(1)=$44:FC(2)=$44:FC(3)=$44:FC(4)=$20 ' // c
    '    Case 100                   
    '    	FC(0)=$38:FC(1)=$44:FC(2)=$44:FC(3)=$48:FC(4)=$7F ' // d
    '    Case 101                   
    '    	FC(0)=$38:FC(1)=$54:FC(2)=$54:FC(3)=$54:FC(4)=$18 ' // e
    '    Case 102                   
    '    	FC(0)=$08:FC(1)=$7E:FC(2)=$09:FC(3)=$01:FC(4)=$02 ' // f
    '    Case 103                   
    '    	FC(0)=$0C:FC(1)=$52:FC(2)=$52:FC(3)=$52:FC(4)=$3E ' // g
    '    Case 104                   
    '    	FC(0)=$7F:FC(1)=$08:FC(2)=$04:FC(3)=$04:FC(4)=$78 ' // h
    '    Case 105                   
    '    	FC(0)=$00:FC(1)=$44:FC(2)=$7D:FC(3)=$40:FC(4)=$00 ' // i
    '    Case 106                   
    '    	FC(0)=$20:FC(1)=$40:FC(2)=$44:FC(3)=$3D:FC(4)=$00 ' // j
    '    Case 107                   
    '    	FC(0)=$7F:FC(1)=$10:FC(2)=$28:FC(3)=$44:FC(4)=$00 ' // k
    '    Case 108                   
    '    	FC(0)=$00:FC(1)=$41:FC(2)=$7F:FC(3)=$40:FC(4)=$00 ' // l
    '    Case 109                   
    '    	FC(0)=$7C:FC(1)=$04:FC(2)=$18:FC(3)=$04:FC(4)=$78 ' // m
    '    Case 110                   
    '    	FC(0)=$7C:FC(1)=$08:FC(2)=$04:FC(3)=$04:FC(4)=$78 ' // n
    '    Case 111                   
    '    	FC(0)=$38:FC(1)=$44:FC(2)=$44:FC(3)=$44:FC(4)=$38 ' // o
    '    Case 112                   
    '    	FC(0)=$7C:FC(1)=$14:FC(2)=$14:FC(3)=$14:FC(4)=$08 ' // p
    '    Case 113                   
    '    	FC(0)=$08:FC(1)=$14:FC(2)=$14:FC(3)=$18:FC(4)=$7C ' // q
    '    Case 114                   
    '    	FC(0)=$7C:FC(1)=$08:FC(2)=$04:FC(3)=$04:FC(4)=$08 ' // r
    '    Case 115                   
    '    	FC(0)=$48:FC(1)=$54:FC(2)=$54:FC(3)=$54:FC(4)=$20 ' // s
    '    Case 116                   
    '    	FC(0)=$04:FC(1)=$3F:FC(2)=$44:FC(3)=$40:FC(4)=$20 ' // t
    '    Case 117                   
    '    	FC(0)=$3C:FC(1)=$40:FC(2)=$40:FC(3)=$20:FC(4)=$7C ' // u
    '    Case 118                   
    '    	FC(0)=$1C:FC(1)=$20:FC(2)=$40:FC(3)=$20:FC(4)=$1C ' // v
    '    Case 119                   
    '    	FC(0)=$3C:FC(1)=$40:FC(2)=$30:FC(3)=$40:FC(4)=$3C ' // w
    '    Case 120                    
    '    	FC(0)=$44:FC(1)=$28:FC(2)=$10:FC(3)=$28:FC(4)=$44 ' // x 
    '    Case 121                    
    '    	FC(0)=$0C:FC(1)=$50:FC(2)=$50:FC(3)=$50:FC(4)=$3C ' // y 
    '    Case 122                    
    '    	FC(0)=$44:FC(1)=$64:FC(2)=$54:FC(3)=$4C:FC(4)=$44 ' // z 
    '    case 123
    '        FC(0)=$00:FC(1)=$08:FC(2)=$36:FC(3)=$41:FC(4)=$00'  // {
    '    case 124
    '        FC(0)=$00:FC(1)=$00:FC(2)=$7F:FC(3)=$00:FC(4)=$00 ' // |
    '    case 125
    '        FC(0)=$00:FC(1)=$41:FC(2)=$36:FC(3)=$08:FC(4)=$00'  // }    
    '    case 126
    '        FC(0)=$10:FC(1)=$08:FC(2)=$08:FC(3)=$10:FC(4)=$08'  // ~
        end SELECT
    Write_LCD:
        High Lcd_DC
        SHiftOUT Lcd_SDO , Lcd_CLK , MSBFIRST, [ FC(0),FC(1),FC(2),FC(3),FC(4),$00 ]
        Low Lcd_DC
        Return
    For the whole include file, you can look at: http://www.picbasic.co.uk/forum/showpost.php?p=73728
    Last edited by ScaleRobotics; - 22nd May 2009 at 16:45.
    http://www.scalerobotics.com

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Ok, for some reason it works if you say DATA @10,some data here, then when you have gotten about half way through the eeprom, stop writting, then start writing again where you left off with DATA 128(or where ever you left off at),rest of your data here.

    Don't know why you can't do it like you originally tried, but PBP does not seem to like it.
    Last edited by ScaleRobotics; - 23rd May 2009 at 16:25.
    http://www.scalerobotics.com

  3. #3
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    Thanks for repply ! I will try both variants.
    With this :
    DATA @110,$7E,$11,$11,$11,$7E,_ ' 65 A 22
    $7F,$49,$49,$49,$36,_ ' 66 B 23
    $3E,$41,$41,$41,$22,_ ' 67 C 24
    $7F,$41,$41,$22,$1C,_ ' 68 D 25
    $7F,$49,$49,$49,$41,_ ' 69 E 26
    $7F,$09,$09,$09,$01,_ ' 70 F 27
    $3E,$41,$49,$49,$7A,_ ' 71 G 28 etc,etc...
    I have another 25 characters ...enough for me. THANK YOU !
    Last edited by fratello; - 23rd May 2009 at 21:26. Reason: Later edit

  4. #4
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    This is final version. I try to implement the function of clock (like this : http://www.picbasic.co.uk/forum/show...ght=clock+code ) but, even the code works verry, verry fine alone, I can't put together with my thermo....If somebody can do this...All the best !
    Attached Images Attached Images  

  5. #5
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    Hello ! Me again... Using PIC 16F628 (or A) with 4 MHz X-tal, one DS18B20 on port RA1, push-button for setting Hours on RB3 and for setting Minutes on RB2, I wrote the code for this thermo_clock. Works verry fine ! All the best !
    Attached Images Attached Images  
    Attached Files Attached Files

  6. #6
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Good to hear Bill.

    But what is the problem with 16f's? Mine compiles without errors for a 16f876a, if I change the ports to match. But I don't have a way to test it here.

  7. #7
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    116


    Did you find this post helpful? Yes | No

    Default

    Hi Walter,

    Making the appropriate changes per chip (cmcon, adcon, etc.) and my same code with the same INC file as compiles correctly with the 18F252, I have no luck with a 16F648A or 16F876A.

    I thought the INC font string may have been too long also so shortened it to about half its size but no difference. Here is what I get...

    With a 16F648A:
    Error[113] e:\wjs\pbp260\pbppic14.lib 449 : Symbol not previously defined [EEADRH]
    Message[303] e:\wjs\pbp\NOD157~1.ASM 185 : Program word too large. Truncated to core size. (4920)
    too many errors

    With a 16F876A there are 20 lines of:
    Message[303] e:\wjs\pbp\NOD157~1.ASM 187 : Program word too large. Truncated to core size. (4920)

    Does this give you any ideas where my problem with 16F's is? What are the chip requirements for using this macro - codespace, ram size, etc,?

    Thanks and regards,
    Bill

  8. #8
    farhang's Avatar
    farhang Guest


    Did you find this post helpful? Yes | No

    Default Re: Using Nokia LCD

    Hi,could you please send me hex code an schematic for me, my email [email protected] many thanks.

  9. #9
    Join Date
    Nov 2008
    Posts
    96


    Did you find this post helpful? Yes | No

    Default Odd compile error...

    (I see this thread is quite inactive, maybe that means there is another more active ??)

    I am trying out Steves code for driving a 5110 screen (bought here http://dx.com/p/arduino-1-6-lcd-disp...-silver-140226 )
    It works very well, except for one of his examples. In the more complex example called 'USINGGLCDOUT_CMD_16F---' I get an error during compiling, and I've tried a few tricks but nothing has got passed it (I modified it for a 16F819, but other than the pic specific configs and the pins I chose use nothing else is changed).

    Here it is.
    PICBASIC PRO(TM) Compiler 3.0.1.4, (c) 1998, 2011 microEngineering Labs, Inc.
    All Rights Reserved.
    [ERROR] usingglcdout_cmd_16f819.pbp (57) : Reading DEFINE Block

    it comes from this define I think (which works fine in the other less complex examples about using variables and constants).
    DEFINE GLCD_2DEC_USED
    INCLUDE "..\Include\GLCD_NOKIA.PBP" ' Plug the Nokia Driver/Wrapper in here

    If I remark out the define I get this when I compile.
    PICBASIC PRO(TM) Compiler 3.0.1.4, (c) 1998, 2011 microEngineering Labs, Inc.
    All Rights Reserved.
    [ASM ERROR] USINGGLCDOUT_CMD_16F819.ASM (562) : ERROR: (Seems you forgot to add DEFINE GLCD_2DEC_USED to your code...)
    Which you'd expect.

    I can post up the whole example code if anyone wants, but it's right out of Steve's examples.
    I'm wondering if it's something to do with PBP3.

    Anyone got a clue ?
    Keeping in mind that his other examples compile and run fine, and I tried his code with and without my config and pin changes..

    Martin
    Last edited by mr.sneezy; - 27th February 2013 at 09:07.

  10. #10
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    116


    Did you find this post helpful? Yes | No

    Default Re: Odd compile error...

    Hi Martin,

    Did you receive an answer from Steve on this? Is there another thread?

    Cheers,
    Bill

  11. #11
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    116


    Did you find this post helpful? Yes | No

    Default Re: Using Nokia LCD

    @ mister_e

    Steve,

    Firstly thanks for all the hard work you put into making the Nokia 3310 Glcd a success. I've only recently discovered it and now use the library a lot.

    May I ask for some advice on how to implement a change from only displaying dec characters to include hex? I've been through the samples and documentation but I don't see anything. Unfortunately I don't have an asm skills yet.

    If this has been achieved by other users or appears elsewhere I'd appreciate some guidance. No rush.

    Kind regards,
    Bill

  12. #12
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Hi Bill,

    After looking at it and testing for a while, there was an error in most of my early includes files. I learned about the jumpover a little late. I compensated for this in my example programs, but it made it harder for others to use.

    For instance, in your LCD_3310v32.inc file, please change goto Start to goto OverLCD

    and at the very bottom of this include file, add this line: OverLCD:

    This fixed your code for me.

    Edit: and you should have _j or any other variable, but not _Variable as your variable. _Variable is used in the macro to get your variable. So use: PrintVar x,x, _j or something.
    Last edited by ScaleRobotics; - 5th July 2010 at 20:09.

  13. #13
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    116


    Did you find this post helpful? Yes | No

    Thumbs up All good now

    Hi Walter,

    That did the trick, thank you! Now if we can only get it to work on 16F chips... any takers?

    Regards to all,
    Bill

Similar Threads

  1. Nokia COLOR LCD PicBasicPro 2.50a example code
    By skimask in forum Code Examples
    Replies: 49
    Last Post: - 28th September 2011, 02:43
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 20:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 17:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 27th June 2007, 00:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 03:30

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts