Using Nokia LCD - Page 4


+ Reply to Thread
Page 4 of 8 FirstFirst 12345678 LastLast
Results 121 to 160 of 301

Thread: Using Nokia LCD

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

    Default

    Here is an include file that has been modified from many peoples code in this thread, and Darrel's PrintStr function, for the nokia-3310. It allows for very simple printing to the LCD.

    You can also print different things on the same line, by using the x, and y, positions.

    example:
    Code:
    DEFINE OSC 48
    
    include "modedefs.bas"
    include "LCD_3310.pbp"
    start:
    
    @ PrintStr  0,0, "I love being"
    @ PrintStr  0,1, "able to print "
    @ PrintStr  0,2, "so easily!"
    Attached Files Attached Files

  2. #122
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191

    Post

    Very nice! Now printing to Nokia LCD is definitely easier.
    Thank You and Darrel!

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

    Default

    Hi again !
    Based on the schematic from post #119 I wrote the code from the thermostat ; but nothing happening when I push button on pin 7, or 8, or 9. I know that something is wrong, but I need help...Thanks in advance for every reply !
    Attached Files Attached Files

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

    Default

    Hello fratello,

    Can you tell us if there are any parts that do work? It is always easier to trouble shoot if you know where to start.

    Like:
    Can it blink an LED, or are we unsure if it is even starting up?
    Does it print to the LCD, and just not give you the temperature, or is the LCD blank?

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

    Default

    Thanks for reply !
    The display show like in picture from post #116. But pushing the buttons '+' , '-' or 'Mode' has no effect.

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

    Default

    Hello Fratello,

    I have been looking over your code for a while now. I have not found anything obvious to me, although there may be something obvious to others.

    One thing I did notice, is that your MainLoop will cycle through modes 0, 1, and 2, even without any buttons being pressed. This is fine, but one thing you are doing in mode 2, and after mode 2, is writing to the eeprom. At 4 mhz, you will reach that 1,000,000 write cycles quicker than you think (have not calculated it, but if this is really going to be a thermostat, I assume it is going to be running for a while). A better way to do it would be to only write the targettemp, etc to the eeprom when targettemp is different than the eeprom value for targettemp (ie, it has been adjusted).

    Seems like the next step is to see if the 16f628a even knows if the buttons have been pressed. Why not make a simple light an LED line inside some of your if then statements to verify the chip knows a button has been pressed? This could help point to the source of the problem.

    Walter

  7. #127
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default

    The code works PERFECT with LCD 2x16...I just try to insert the parts for Nokia display...(and removing, of course, the parts for other display). I think the problems are generated by wrong 'substitution'. Thanks anyway for reply !

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

    Default

    That's great! If it is working perfectly with the 2 x 16 lcd, you should be seeing the new changed values in your eeprom. This should be an indication that only your LCD_3310 code is bad, and that the thermostat functions are working!

  9. #129
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,817

    Default

    Hi fratello, Do you have pullup resistors on those switches ? You do not have WPU enabled, so you need them, or change the Option_Reg, to enable them.
    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.

  10. #130
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default

    Me again !
    I found the mistake ; after MainLoop the code must be :
    If PortB.3=0 then ; this is the missing line
    If PortB.3=0 then MainLoop
    ...
    ...
    Endif
    Endif

    Work correct on pushing MODE button , but...
    Now I have another problem... I attach the code for display the temperature in both cases (LCD 2X16 ; N3310).
    How do I convert this line :
    LcdOut $FE, $C0, "OUT ", Sign, DEC (Temperature2 / 100), ".", DEC2 Temperature2, " ",223,"C "
    for correct results on Nokia display ?
    DEC (Temperature2 /100) it's what char ?
    DEC2 Temperature2 it's what char ?
    I try many codes but on display appears numbers and strange characters....
    Thanks !
    Attached Files Attached Files

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

    Default

    Quote Originally Posted by fratello View Post
    How do I convert this line :
    LcdOut $FE, $C0, "OUT ", Sign, DEC (Temperature2 / 100), ".", DEC2 Temperature2, " ",223,"C "
    for correct results on Nokia display ?
    DEC (Temperature2 /100) it's what char ?
    DEC2 Temperature2 it's what char ?
    Here I am assuming that at 25.1 degrees c , Temperature2 = 2510
    On yours, it looks like it would be:
    Code:
    char = (Temperature2 dig 3) + 2      'get digit 3 ("2"510) and add 2 so it matches eeprom  
           move x y to right location and print it   'do whatever you do to print to lcd
    char = (Temperature2 dig 2) + 2      'get digit 2 (2"5"10) and add 2
           move x y to right location and print it   
    char = 14                            'in you eeprom this is a "."
           move x y to right location and print it   
    char = (Temperature2 dig 1) + 2      'get digit 1 (25"1"0) and add 2
           move x y to right location and print it
    But I thought from your picture in post #116 that you were printing temperature already?

    Now I am confused again...

    I now see that your change to MainLoop fixes the write to eeprom every cycle problem too. Very nice.
    Last edited by ScaleRobotics; - 26th April 2009 at 22:06.

  12. #132
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    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

  13. #133
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    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

  14. #134
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    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

  15. #135
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,817

    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.

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

    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

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

    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

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

    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

  19. #139
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    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 !

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

    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

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

    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

  22. #142
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,817

    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.

  23. #143
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default

    Hi to all !
    Me again...with one new problem : I write the code attached, for 16F648A, because I want to display some graphics elements (see sus, rand 1, rand 2, rand 3, rand 4, jos) .But when I put the code in Microcode Studio I receive the message "Warn : Test_648.asm 790:[102] code crosses boundary @ 800h". I think the code it's too big; please give me some solution !!! I want that my display having one nice 'looking' and without the parts for graphics elements...What can I do ?
    Thanks in advance !
    Attached Files Attached Files

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

    Default

    That is just a warning that you are crossing a boundary. All is good. How many bytes does it say you are using the lower left of microcode studio?
    http://www.scalerobotics.com

  25. #145
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default

    This is what MicroCode Studio say :
    Attached Images Attached Images  

  26. #146
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191

    Post

    Quote Originally Posted by fratello View Post
    This is what MicroCode Studio say :
    Your code compiles OK (2932 words used). I don't understand what can be wrong with your setup? If you close and restart the MicroCode Studio, would that help? At least sometime that has helped me.

    To get rid of "code crosses boundary" goto tool bar:
    View -> Editor Options...
    In General sheet, select "Disable 'code crosses boundary' ASM warning.

    BR,
    -Gusse-
    Last edited by Gusse; - 5th May 2009 at 14:59.

  27. #147
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898

    Default

    The first one is about your config fuse. intrc_osc should be replaced by
    Code:
    INTRC_OSC_NOCLKOUT
    This one use the same config fuses as 16F628A & 16F627A. The complete list is in M16F62XA.inc file in pbp\inc folder.

    The second one is just a warning,
    http://picbasic.co.uk/forum/showthread.php?t=555&

    Can be bypass within MicroCode Studio.
    http://www.picbasic.co.uk/forum/show...66&postcount=2

    EDIT: Gusse, that's what happen when few people think the same thing at the same time
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  28. #148
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,104

    Default

    Code is OK. May be you need a restart.

    Steve, the define is OK. It exists this too!

    Ioannis

  29. #149
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default

    OK ! Thanks ! I just wait for the 16F648A...

  30. #150
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default

    I have the 648A. The code works just fine !
    ...but : I try to define anothers characters for display the temperature that I set ; the message is like in picture. How can I define anothers characters ?
    Thanks in advance !
    Attached Images Attached Images  
    Attached Files Attached Files

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

    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:;<=>[email protected]"],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 15:45.
    http://www.scalerobotics.com

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

    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 15:25.
    http://www.scalerobotics.com

  33. #153
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    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 20:26. Reason: Later edit

  34. #154
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    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  

  35. #155
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    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

  36. #156

    Default speedoometer+code lock with 3310 lcd

    I want make digital code lock + speedometer with pic and 3310 lcd
    Plz help me for code in picbasic
    On the meter then first code lock on if code don then speedometer on
    And distance save in pic internal eeprom


    Tahir maqsood

  37. #157
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default ?

    Based on code that I post at #155, it is possible to use BIG fonts like in this example : http://users.picbasic.org/Howto/PPRI...t%20update.pdf ? Of course, just display the temperature, with big font, without others graphical elements... The commands are in Proton+ ,but it's possible to use with PBP ? What are You thinking ? Thanks in advance for every repply !

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

    Default bitmap fonts

    It looks possible. You would have to create custom characters for the 3310. Some helper bitmap font editors are available, like http://www.crystalfontz.com/forum/showthread.php?t=3619 to help you write the code for each character. How big are you wanting to go?. The link I showed goes to 10 x 14. But a font like this 10x14 (just look at fonts on this link) is bolder http://www.ageta.hu/pdf/gw64x16C-K610a-03.pdf. But perhaps you want even larger?
    Last edited by ScaleRobotics; - 5th April 2010 at 16:56.

  39. #159
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default

    Please take a look at this ideea :
    -in picture I figure how increase the size of characters ;
    -in the code I try to explain how I see the problem.
    Suggestions ? Thanks !
    Code:
    ' So I define the normal characters : 
                       DATA @10,$3E,$51,$49,$45,$3E,_       ';// 0                
                                $00,$42,$7F,$40,$00,_       ';// 1    
                                $42,$61,$51,$49,$46,_       ';// 2    
                                $21,$41,$45,$4B,$31,_       ';// 3    
                                $18,$14,$12,$7F,$10,_       ';// 4    
                                $27,$45,$45,$45,$39,_       ';// 5    
                                $3C,$4A,$49,$49,$30,_       ';// 6    
                                $01,$71,$09,$05,$03,_       ';// 7    
                                $36,$49,$49,$49,$36,_       ';// 8    
                                $06,$49,$49,$29,$1E,_       ';// 9    
                                $08,$08,$3E,$08,$08,_       ';// +    
                                $08,$08,$08,$08,$08,_       ';// -    
    ' and display the temperature :
    '================= setting cursor for display the temperature 
                    LcdReg  =  %10100000 + 22       ' cursor  X
                    call    PrintCtrlLcd
                    LcdReg  =  %01000010            ' cursor  Y
                    call    PrintCtrlLcd
    '================= now display temperature                  
                    Char = (temperature dig 3)            
                    call    PrintChar
                    Char = (temperature dig 2)           
                    call    PrintChar
                    Char = 14                       ' this is decimal point           
                    call    PrintChar
                    Char = (temperature dig 1)      
                    Call    PrintChar 
    '
    'here I try to display with BIG font :
    '===============================================
    ' try to define BIG zero :
                       DATA @10,$1F,$1F,$66,$66,$61,_       ';// the 1/4 left-down  part of zero
                                $7C,$7C,$03,$03,$43,_       ';// the 1/4 left-up    part of zero
                                $43,$33,$33,$7C,$7C,_       ';// the 1/4 right-up   part of zero
                                $61,$60,$60,$1F,$1F,_       ';// the 1/4 right-down part of zero
                                
    ' and display the temperature :
    '================= setting cursor for display the temperature 
                    LcdReg  =  %10100000 + 22       ' cursor  X
                    call    PrintCtrlLcd
                    LcdReg  =  %01000010            ' cursor  Y
                    call    PrintCtrlLcd
    '================= now display temperature                    
                    Char = ??????????           
                    call    PrintChar
                    Char = ??????????       
                    call    PrintChar
                    Char = ??????????                       ' redefine of decimal point           
                    call    PrintChar
                    Char = ??????????    
                    Call    PrintChar
    Attached Images Attached Images  

  40. #160
    Join Date
    Apr 2008
    Location
    Lisbon-Portugal
    Posts
    6

    Default Increase the size of characters

    Have you see the code of the post #82?

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

Posting Permissions

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