Using Nokia LCD


Closed Thread
Results 1 to 40 of 301

Thread: Using Nokia LCD

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    THANK YOU ! And THANK YOU ALL !
    It's work ! Yes !!!!!! I'm -once again, thanks to you, all- happy !
    This is the 1.0 version of code for dual zone & thermostat with Nokia 3310 display ! All the best to all !
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default

    Version 2. Some minors but necessary modifications. Tested - function of thermostat work fine. Not tested for negative temperatures...
    Attached Images Attached Images  
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default

    Tested with negative temperatures; bug fixed !
    I can't - insuficient memory ! - using design like in post #116 (borders & author name). How to free memory ? I think the code can be optimized...
    Attached Files Attached Files

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fratello View Post
    Tested with negative temperatures; bug fixed !
    I can't - insuficient memory ! - using design like in post #116 (borders & author name). How to free memory ? I think the code can be optimized...
    Easiest way . . . Use 16f648A, then you have room to stretch your legs.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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


    Did you find this post helpful? Yes | No

    Default

    Agreed, to upgrade to bigger chip is probably the best way.
    If you just need to try a little more room, you could try taking out your graphics:

    cut out:
    Code:
    BorderLine: 
    '=================================== UP
                    LcdReg  =  %10000000            ' cursor  X  
                   call    PrintCtrlLcd
                    LcdReg  =  %01000000            ' cursor  Y
                   call    PrintCtrlLcd
                     for y = 0 to 73                   
          LOokup y, [$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$3F,$3F,$21,$21,$3F,$1E,$00,$3F,$3F,$00,_
    		     $1E,$3F,$21,$29,$3B,$1A,$00,$3F,$3F,$00,_
                     $01,$01,$3F,$3F,$01,$01,$00,$3E,$3F,$09,$09,$3F,$3E,$00,_
                     $3F,$3F,$20,$20,$20,_
                     $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,_
    		     $18,$27,$27,$18,$00,$00,$00,$00,$06,$06,_
    		     $00,$1E,$3F,$21,$21] ,LcdReg   
    
    '                 for y = 0 to 83                   
    '      LOokup y, [$01,$01,$01,$01,$01,$01,$01,$01,_
    '                 $01,$01,$01,$01,$01,$01,$7F,$7F,$43,$43,$7F,$3D,$01,$7F,$7F,$01,_            'DI
    '                 $3D,$7F,$43,$53,$77,$35,$01,$7F,$7F,$01,$03,$03,$7F,$7F,$03,$03,$01,_        'GIT
    '                 $7D,$7F,$13,$13,$7F,$7D,$01,$7F,$7F,$41,$41,$41,$01,$01,$01,$01,$01,_        'AL
    '  		     $01,$01,$01,$31,$4F,$4F,$31,$01,$01,$01,$0D,$0D,$01,$3D,$7F,$43,$43,$43,_
    '		     $01,$01,$01,$01,$01,$01,$01,01] ,LcdReg       
       
                       call    PrintDataLcd
                        next y
    
     
    '===================================  DOWN                
    '		    LcdReg  =  %10000000            ' cursor  X  
    '               call    PrintCtrlLcd
    '                LcdReg  =  %01000101            ' cursor  Y
    '               call    PrintCtrlLcd
    '                 for y = 0 to 83 
    '      LOokup y, [$80,$80,$80,$80,$80,$80,$FE,$CA,$CA,$B4,$80,$8E,$D0,$D0,$BE,_          'BY      
    '		     $80,$80,$80,$80,$FE,$88,$90,$FE,$80,$FE,$80,$BC,$C2,$C2,$A4,_          'NIC
    '                 $80,$BE,$C0,$C0,$BE,$80,$FE,$C0,$C0,$C0,$80,$FE,$CA,$CA,$C2,_          'ULE
    '	           $80,$A4,$CA,$CA,$B0,$80,$BC,$C2,$C2,$A4,$80,$BE,$C0,$C0,$BE,_          'SCU
    '		     $80,$80,$80,$80,$FE,$C2,$C2,$BC,$80,$FC,$92,$92,$FC,$80,$FE,_          'DAN
    '		     $88,$90,$FE,$80,$80,$80,$80,$80,$80] ,LcdReg             
    '
    '                   call    PrintDataLcd
    '                    next y 
           return
    
     '=================================== end of BorderLine

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


    Did you find this post helpful? Yes | No

    Default Easy to print variables (and long strings)

    Ok, the printing a variable solution:
    Code:
    PosX = 0                          'position 0 of 84 in the x direction
    PosY = 0                           'row 0 (of 0-5)
    gosub Lcd_GotoXY
    Lcd_Data = (result dig 3) + 48
    gosub Lcd_SendChar
    
    PosX = 6                          'position 6 of 84 in the x direction
    PosY = 0                           'row 0 (of 0-5)
    gosub Lcd_GotoXY
    Lcd_Data = (result dig 2)+ 48
    gosub Lcd_SendChar
    
    PosX = 12                          'position 12 of 84 in the x direction
    PosY = 0                           'row 0 (of 0-5)
    gosub Lcd_GotoXY
    Lcd_Data = (result dig 1) + 48
    gosub Lcd_SendChar
    
    PosX = 18                          'position 18 of 84 in the x direction
    PosY = 0                           'row 0 (of 0-5)
    gosub Lcd_GotoXY
    Lcd_Data = (result dig 0) + 48
    gosub Lcd_SendChar
    got a little old. So I managed to write my first macro. It lets you do the above with a two liner:

    Code:
        
    VarData = 12345   'load the variable with desired number
    @ PrintVar 0,0      'print the variable VarData, starting at the desired location 0,0
    The code does the rest, and moves to the next position to print the next digit, until done.
    I also edited the PrintStr function to scroll to the next line when it runs past the end of the current line.

    Code:
    @ PrintStr 0,0, "If I write more than one line, it will scroll to the next one, and next."
    It runs on an 18f67j50. Not sure if it would run on a 16f or not.
    Attached Files Attached Files

  7. #7
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fratello View Post
    Tested with negative temperatures; bug fixed !
    I can't - insuficient memory ! - using design like in post #116 (borders & author name). How to free memory ? I think the code can be optimized...
    Hi Fratello,
    I tried to compile the file you put here. It did not give any error to me like what you said. The resultant files are appended in the zip file for ready reference.
    Attached Files Attached Files
    Regards,
    Sarma

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


    Did you find this post helpful? Yes | No

    Default

    The code is full functionaly ! The graphics it's disable... If try to improve the way that "look" the display, it is no more space in memory...I think the solution it's to 'up-grade' to another PIC, with bigger memory !

  9. #9
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fratello View Post
    The code is full functionaly ! The graphics it's disable... If try to improve the way that "look" the display, it is no more space in memory...I think the solution it's to 'up-grade' to another PIC, with bigger memory !
    I feel if one could write straight in assembly language, it would be smaller, in size. my comments may not suite the site s it is meant for promoting BASIC
    Regards,
    Sarma

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


    Did you find this post helpful? Yes | No

    Default

    I found out how to add variables to my macro, so now using the include file, you can print any variable to the lcd by using:

    @ PrintVar x,y, _anyvariablehere

    (instead of loading a specific variable , then using @ PrintVar that I had before). Small change, but I figured it might help someone.

    Here is the segment of the macro that is part of the lcd_3310v31 include file (attached).
    Code:
    '@ PrintVar macro function 
    'format should look like this: @ PrintVar x,y, _anyvariable
    ASM
    PrintVar macro x, y, Variable ;input values from: @PrintVar 0,1, _any_variable  
        local OverVar                
        goto OverVar                
    OverVar
        MOVE?CB  x, _PosX           ;move x from above statement to PosX
        MOVE?CB  y, _PosY           ;move y from above statement to PosY
        MOVE?WW  Variable, _VarData ;move variable in statement to VarData
        L?CALL   _VariableOut       ;call VariableOut function
        endm
    ENDASM
    
    VariableOut:
        @ bcf _digits
        for n = 4 to 0 step -1        'cycles through all possible digts of number
            Gosub Lcd_GotoXY          'place character at position PosX and PosY
            Lcd_Data = (VarData dig n) + 48 'digit number n to character str format
            if Lcd_data = 48 and digits = 0 then SkipChar 'skip if first char is 0
            @ bsf _digits             ;show that one character has been printed
            gosub Lcd_SendChar        'print char to screen
            PosX = PosX + 6           'next x position for character
    SkipChar:        
        next n
    return
    Attached Files Attached Files
    http://www.scalerobotics.com

  11. #11
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mvs_sarma View Post
    I feel if one could write straight in assembly language, it would be smaller, in size. my comments may not suite the site s it is meant for promoting BASIC
    Hi Sarma,
    Certainly well written assembly code should use less space than assembly generated by a high level compiler, it all boils down to cost. If you live where the cost of living is very low and software engineers are paid little, assembly may be the correct path. If you live where everything costs way too much and software engineers start out at $50,000 and go way up from there, it becomes very difficult to recover that cost by saving $0.15 on the wholesale cost of the PIC. One other consideration in both instances, if the engineer uses the high level compiler, the time saved will be used to engineer more products. So IMHO, the way to achieve best overall results is High Level compiler WITH assembly assists, I E . . . Darrels Instant interrupts for example. As for your comments . . . Your comments are welcome here. We all benefit by sharing our Ideas and opinions, and we can keep them after sharing or adopt new ones, I believe it was Albert Einstein who said, " all knowledge is trial and error", which is to say the things you are taught are the result of somebody's mistakes.
    Regards,
    Joe S.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

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