Using Nokia LCD - Page 5


+ Reply to Thread
Page 5 of 8 FirstFirst 12345678 LastLast
Results 161 to 200 of 301

Thread: Using Nokia LCD

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

    Default Great job, indeed !

    ... but, please, on my code for simple thermometer, can You tell me how re-define the characters and how to display ? Just with BIG characters ! Thanks in advance, even for a little clue ...
    Code:
    '*********************************************
    '               Thermometer 
    '          with Nokia 3310 display
    @ DEVICE pic16F628A, XT_OSC, WDT_OFF, PWRT_OFF, BOD_OFF, MCLR_OFF, LVP_OFF, CPD_OFF, PROTECT_OFF       
    
    DEFINE  NO_CLRWDT 1
    DEFINE  OSC 4                            
    
            TRISB = %00001110        'portB configuration  ; 0=out 1=in
            TRISA = %10100010        'portA configuration
    
            PortA = %11100010        
            CMCON = 7                
            VRCON = 0                
            INTCON = 0              
            OPTION_REG = %00000111   '
                        
    RST         var  PortA.4         'pin 3   Output   reset display
    SDIN        var  PortA.3         'pin 2   Output   master data out        
    SCK         var  PortA.2         'pin 1   Output   Spi clock
    DQ          var  PortA.1         'pin 18  I/O      DQ DS18b20    
    D_C         var  PortB.0         'pin 6   Output   command/data sel. register
    
                
                temperature     var  Word	
                tref            var  word
                TempC           var  Byte
                Float           var  Byte
                Dummy           var  Byte
                Flag            var  Byte          
                SignBit         var  Flag.0
                Minus           var  Byte                   
                LcdReg          var  Byte        
                x               var  Byte
                y               var  Byte
                Offset          var  Byte
                Char            var  Byte
                a               var  Byte
                PosX            var  Byte
                PosY            var  Byte
                Chr             var  Byte
                LcdData         var  Byte
                V               var  Word		 
                Sign            var  Byte
                Busy            VAR  BIT         ' Busy Status-Bit
    
    DS18B20_12bit 	CON %01111111                  ' 750ms,   0.0625C  
    
    
    '====================================================================           
                    
         DATA @10,$7E,$91,$89,$85,$7E,_       ';// 0        
                  $00,$82,$FF,$80,$00,_       ';// 1    
                  $82,$C1,$A1,$91,$8E,_       ';// 2     
                  $42,$81,$89,$89,$76,_       ';// 3    
                  $18,$14,$12,$FF,$10,_       ';// 4    
                  $4F,$89,$89,$89,$71,_       ';// 5    
                  $7E,$89,$89,$89,$72,_       ';// 6    
                  $01,$E1,$11,$09,$07,_       ';// 7    
                  $76,$89,$89,$89,$76,_       ';// 8    
                  $46,$89,$89,$89,$7E,_       ';// 9 
                  $08,$08,$3E,$08,$08,_       ';// +   10
                  $08,$08,$08,$08,$08,_       ';// -   11
                  $00,$C0,$C0,$00,$00         ';// .   12
    
    '====================================================================           
                  pause 100
                  RST = 1
                  PortB = 0                      
                  LcdReg  =  %00100001        'LCD Extended Commands.
                  call    PrintCtrlLcd
                  LcdReg  =  $C8              'Set LCD Vop (Contrast)
                  call    PrintCtrlLcd
                  LcdReg  =  %00000110        'Set Temp coefficent.
                  call    PrintCtrlLcd
                  LcdReg  =  %00010011        'LCD bias mode 1:48.
                  call    PrintCtrlLcd
                  LcdReg  =  %00100000        'LCD Standard Commands, Horizontal addressing mode.
                  call    PrintCtrlLcd
                  LcdReg  =  $0C              'LCD in normal mode.  $0D inverse
    
    Call  PrintCtrlLcd                 
    Call 	CursorHome               
    Gosub LCD_Clear
    
    '====================================================================
    
    OWOut DQ, 1, [$CC, $4E, 0, 0, DS18B20_12bit]
     Output DQ             			            ' Make Pin Output
     DQ=0					                          ' OneWire line Low
     PauseUs 480                            ' Keep down for 480 S  
     Input DQ                               ' Make Pin Input
     PauseUs 70                             ' Wait 70 S
    
    OPTION_REG.7=1
    TMR0=0
    INTCON.2=0
    
    
    W1: 
        OWIN DQ,4,[busy]                     'Check for still busy converting
        IF busy = 0 THEN W1                  'Still busy?, then loop
    
    
    CALL BorderLine
    
    
    '====================================================================
    
    Main:  
    ClockLoop: IF INTCON.2=0 THEN ClockLoop
    INTCON.2=0
    CALL BorderLine
    
    
     OWOut DQ, 1, [$CC, $44] 
     OWOut DQ, 1, [$CC, $BE]
     OWIn DQ, 2, [temperature.byte0, temperature.byte1]         
                    SignBit = 0
                    if  temperature.15 then  
                        temperature  = ~ temperature + 1 
                        SignBit = 1 
                    endif  
                    
    Dummy = 625 * Temperature
    TempC = DIV32 10
    TempC = (Temperature & $7FF) >> 4
    Float = ((Temperature.Lowbyte & $0F ) * 25 )>>2
    Temperature=TempC*100 + Float         
     	If SignBit then
      		V= 10000 - Temperature   	' 25'C=12500  0'C=10000  -10'C=9000 
      		SignBit = 0
     	   else
      		V= 10000 + Temperature
     	EndIf
     
    	If V >= 10000 then             	' Above 0 C.      
      		Temperature=V-10000                   
     	   else                                   
      		Temperature=10000-V      	' Below 0 C. 
     	EndIf
     
     GoSub SelectSign                    	' +/blank/- Sign 
    
    '================= setting cursor for display the temperature 
         LcdReg  =  %10001000                 ' cursor  X
            call    PrintCtrlLcd
         LcdReg  =  %01000010 + 1             ' cursor  Y
            call    PrintCtrlLcd
    '================= now display temperature 
                        if Tempc > 99 then 
                            Char = 3                
                            call    PrintChar
                        else    
                            Char = 12                        ' + plus
                            if SignBit = 1 then Char = 13    ' - minus
                            call    PrintChar
                        endif                  
                    
                    Char = (temperature dig 3) + 2            
                    call    PrintChar
                    Char = (temperature dig 2) + 2           
                    call    PrintChar
                    Char = 14                       
                    call    PrintChar
                    Char = (temperature dig 1) + 2      
                    Call    PrintChar 
                    Char = (temperature dig 0) + 2      
                    Call    PrintChar
    
    goto Main
    
    
    '================== S U B R O U T I N E S ===========================   
               
    '========================== L C D ===================================             
    
    CursorHome:     LcdReg  =  %10000000      ' cursor Home
                    call    PrintCtrlLcd
                    LcdReg  =  %01000000      ' cursor Home
                    call    PrintCtrlLcd
                    return
    
    PrintChar:   offset = Char * 5          
                 
                    for a = 1 to 5                
                        read offset, LcdReg
                        call  PrintDataLcd
                        offset = offset + 1
                    next a
                    LcdReg = 0
                    call    PrintDataLcd
                    return
                                        
    PrintCtrlLcd:   D_C = 0                             
    
    PrintDataLcd:   for x = 1 to 8                
                        SDIN = LcdReg.7              
                        SCK = 1
                        LcdReg = LcdReg << 1
                        SCK = 0
                    next x               
                    D_C = 1
                    return               
                    
    LCD_Clear:
      PosX=0:PosY=0:GOSUB LCD_GotoXY
      HIGH D_C
      FOR Chr=1 TO 252
          LcdData=0:GOSUB LCD_ByteOut
          LcdData=0:GOSUB LCD_ByteOut
      NEXT Chr
    RETURN
    
    LCD_GotoXY:
      LOW D_C
      LcdData=%01000000 | PosY :GOSUB LCD_ByteOut
      LcdData=%10000000 | PosX :GOSUB LCD_ByteOut
    RETURN
    
    LCD_ByteOut:
      SHIFTOUT SDIN,SCK,1,[LcdData]
    RETURN         
    
    '====================================================================
    SelectSign:
     If v = 10000 then                      	' Temperature = 0 C.
      	Sign=" " 				      ' No sign
         Else 
      		If v < 10000 then             ' <> 0
       			Sign="-"			    ' Temperature below 0 C.	
      		    Else
       			Sign="+"			    ' Temperature above 0 C.
      		EndIf
     EndIf
    Return
    
    
    BorderLine: 
    ' Raw 0
    ' Raw 1             
    ' no space for post code here 
    Return                          
    
    '=================================== 
    End        'of program

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

    Default

    You might try something like this. The characters you show as an example could be simplified to fit into half the space, but this allows you to smooth the characters if you like. I did not smooth them, just kept to your example font, so hopefully you can see what I am trying to do. Each hex data point of the character is basically a binary image of the column. It starts at the base of the character, but since our character is going to take 4 character positions, our zero starts at half of the 16 pixels high. So the left column of the top of the zero is 11111100 (or $FC) all the 1's are black. As you can see, it takes a long time to make the characters. There may be a tool out there somewhere to make this easier for you. Hopefully you just need numbers!

    The building of the characters are shown on the data sheet for the display on pages 8-9, and 22-23.
    Code:
    FA VAR BYTE[5] 'upper left of character
    FB VAR BYTE[5] 'upper right of character
    FC VAR BYTE[5] 'lower left of character
    FD VAR BYTE[5] 'lower right of character
    
    '-------------------------------------------------------------------------------    
    ' This part demonstrates how to write to LCD
    Lcd_SendChar:
        lookdown Lcd_data,[" !\#$%&'()*+,-./0123456789:;<=>[email protected][\]^_`abcdefghijklmnopqrstuvwxyz{|}~"],CharNum
        Lcd_data = CharNum +32
        
        SELECT CASE lcd_data
    
        Case 48 ' a zero                   
        	FA(0)=$FC:FA(1)=$FC:FA(2)=$3:FA(3)=$3:FA(4)=$C3 ' // 0
        	FB(0)=$C3:FB(1)=$33:FB(2)=$33:FB(3)=$FC:FB(4)=$FC ' // 0  
        	FC(0)=$0F:FC(1)=$0F:FC(2)=$33:FC(3)=$33:FC(4)=$30 ' // 0
        	FD(0)=$30:FD(1)=$30:FD(2)=$30:FD(3)=$0F:FD(4)=$0F ' // 0  
        Case 49 ' a one                  
    
        
        end SELECT
    Write_LCD:
        High Lcd_DC
        SHiftOUT Lcd_SDO , Lcd_CLK , MSBFIRST, [ FA(0),FA(1),FA(2),FA(3),FA(4)] 'upper left
    'need to point to next position here
        SHiftOUT Lcd_SDO , Lcd_CLK , MSBFIRST, [ FB(0),FB(1),FB(2),FB(3),FB(4),$00,$00] 'upper right
    'need to add code to change location to lower left position for bottom of character here!
        SHiftOUT Lcd_SDO , Lcd_CLK , MSBFIRST, [ FC(0),FC(1),FC(2),FC(3),FC(4)] 'lower left
    'need to add code to change to next position
        SHiftOUT Lcd_SDO , Lcd_CLK , MSBFIRST, [ FD(0),FD(1),FD(2),FD(3),FD(4),$00,$00] 'lower right
    'need to add code to move back to upper level (and shift right) for beginning of next character
        Low Lcd_DC
        Return
    Attached Images Attached Images  
    Last edited by ScaleRobotics; - 7th April 2010 at 03:05.

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

    Default font and bitmap tool

    The attached program fastLCD.zip will help you with text, as well as graphics. It will let you create characters, and it will create hex for them.

    Attached Images Attached Images  
    Attached Files Attached Files

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

    Default Thank You !

    Nice program, but I use already Excel (bin2hex) for those big characters...Unfortunately, I need to understand the codes You and HJota propose and modify all my code; the procedures for define and display the characters are different...Per aspera ad astra ...

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

    Default First step !

    I succeded to display "23.56" ! it's a step, don't ?!
    Now, assuming that I succed to write the code for reading DS18B20, how display temperature instead "23.56" ?
    It's correct so : " lookup i, [temperature DIG 3, temperature DIG 2, temperature DIG 1], j" or how ? Thanks !
    Attached Images Attached Images  
    Attached Files Attached Files

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

    Default

    How about changing from this:
    Code:
    for i=0 to 4
    lookup i,["23.56"],j
    lcdstr(i)=j
    next i
    to something like this:
    Code:
    lcdstr(4) = 48 + temperature dig 3
    lcdstr(3) = 48 + temperature dig 2
    lcdstr(2) = "."
    lcdstr(1) = 48 + temperature dig 1
    lcdstr(0) = 48 + temperature dig 0
    You would have to do something when your temperature goes to single digits though.

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

    Default

    What I put here ?
    Code:
    lcdstr(4) = 48 + temperature dig 3
    lcdstr(3) = 48 + temperature dig 2
    lcdstr(2) = "."
    lcdstr(1) = 48 + temperature dig 1
    lcdstr(0) = 48 + temperature dig 0
    
    Tc=2
    for i=0 to 4
    lookup i,["??????"],j
    lcdstr(i)=j
    next i
    nC=5

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

    Default

    Quote Originally Posted by fratello View Post
    What I put here ?
    Code:
    lcdstr(4) = 48 + temperature dig 3
    lcdstr(3) = 48 + temperature dig 2
    lcdstr(2) = "."
    lcdstr(1) = 48 + temperature dig 1
    lcdstr(0) = 48 + temperature dig 0
    
    Tc=2
    for i=0 to 4
    lookup i,["??????"],j
    lcdstr(i)=j
    next i
    nC=5
    remove the for i = loop. The code above will load the values in the lcdstr string.

  9. #169
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default And the results are...

    like in picture attached. The code works great, with one DS18B20; next project is, of course , termo with two zone, with thermostat, with clock, etc.,....
    THANK YOU ALL !
    Attached Images Attached Images  
    Attached Files Attached Files

  10. #170

    Default 2xDS18B20 Thermometer

    this code not compile
    plz help me
    Thnks
    Attached Images Attached Images  
    Attached Files Attached Files

  11. #171
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default

    Proton IDE ?! MPLAB IDE...

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

    Default

    Hex file (remove .txt extension); use 16F648A, for graphics elements.
    Attached Files Attached Files

  13. #173

    Default

    proton id and DEVICE 16f628a

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

    Default Strange problem with not original display

    Because this topic it's still "hot" I wonder if somebody have meeting this problem : I bought some Nokia 3310 displays and bottom of display appears these stranges characters...using same code and hardware (see post #169). The results on display are like in picture (original vs fake; both display look hardware just the same). Suggestions ?! Thanks !
    Attached Images Attached Images    
    Last edited by fratello; - 17th April 2010 at 12:49.

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

    Default

    Not sure if this will help, but I did notice a difference in the way we initialize the display.

    Try adding some time, and another pause after, and see if that helps.
    Code:
      Low Lcd_RST
      pause 50
      High Lcd_RST
      pause 50
    Otherwise, my only advice would be to try to get from same manufacturer. One display seems to have the part number info on it, the other does not. Is the one with the part info printed on it the working one?

  16. #176
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default Last line don't erase !

    Even with "pause 100" don't work ; still "fleas". And yes, the display with part info printed work good. The last line it's with problem !!!! She don't want to be erased !! I try another program and look at differences. First two foto are with good display; "main" program - and, after LCD_clear , "set" display. The last two are with "fake" display. The last line remain from "main" program display !!!
    Attached Images Attached Images     

  17. #177
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191

    Post

    Quote Originally Posted by fratello View Post
    Even with "pause 100" don't work ; still "fleas". And yes, the display with part info printed work good. The last line it's with problem !!!! She don't want to be erased !! I try another program and look at differences. First two foto are with good display; "main" program - and, after LCD_clear , "set" display. The last two are with "fake" display. The last line remain from "main" program display !!!
    LCD seems to work OK if you can write text to it, to all 6 rows. Try some PAUSE after Lcd_Clear -command if that will make any difference. Could it be so that LCD controller is quite slow and next command will override Lcd_Clear. Just speculations ...

    BR,
    -Gusse-
    Last edited by Gusse; - 18th April 2010 at 21:01.

  18. #178
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default

    Thanks for repply ! But...with "Pause" (10-200 !) it's worst !
    Attached Images Attached Images  

  19. #179
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191

    Post

    Are you using similar LCD_Clear code as in post #161?

    Would code below make any difference?
    At least it has worked for me very well with several different 3310 LCD modules.
    Code:
    <code><font color="#000000">Lcd_Data        <b>VAR BYTE </b>[6]
    
    Lcd_Clear:
        PosX=0:PosY=0:<b>GOSUB </b>Lcd_GotoXY
        <b>HIGH </b>Lcd_DC
        Lcd_Data(0)=0:Lcd_Data(1)=0:Lcd_Data(2)=0:Lcd_Data(3)=0:Lcd_Data(4)=0:Lcd_Data(5)=0
        <b>FOR </b>Char=1 <b>TO </b>84
        <b>GOSUB </b>Write_LCD
        <b>NEXT </b>Char
        <b>RETURN
    
    </b>Write_LCD:
        <b>SHIFTOUT </b>SDIN,SCK,1,[ Lcd_Data(0),Lcd_Data(1),Lcd_Data(2),Lcd_Data(3),Lcd_Data(4),Lcd_Data(5) ]
        <b>RETURN
    
    </b></code>
    BR,
    -Gusse-
    Last edited by Gusse; - 19th April 2010 at 19:00.

  20. #180
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default

    She drives me crazzy ! Don't work ; still "fleas"... verry disappointed ... I have now five display useless...

  21. #181
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default

    Here : http://www.edaboard.com/ftopic324477.html&usg , I find something interesting...

  22. #182
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191

    Default

    So, somebody is selling fake 3310 LCD displays, that are actually with 102*80 controllers. Nice practical joke!
    I bet that those aren't made by Philips, Samsung or Seiko Epson.

    BR,
    -Gusse-
    Last edited by Gusse; - 26th April 2010 at 03:20. Reason: Typo corrections

  23. #183
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191

    Default Workaround ??

    Quote Originally Posted by fratello View Post
    She drives me crazzy ! Don't work ; still "fleas"... verry disappointed ... I have now five display useless...
    Hi Fratello,

    Try this one. It will change row after it has cleared 84 pixels. Old version changed row also after 84, but if you have 102 pixels per row then 502 positions are not enough.

    Code:
    <code><font color="#000000">Lcd_Data        <b>VAR BYTE
    </b>Cursor          <b>VAR BYTE
    
    </b>Lcd_Clear:
        <b>FOR </b>Cursor = 0 <b>TO </b>5
            PosX=0:PosY=Cursor:<b>GOSUB </b>Lcd_GotoXY
            <b>HIGH </b>Lcd_DC
            Lcd_Data = 0
            <b>FOR </b>Char = 1 <b>TO </b>84
                <b>GOSUB </b>LCD_ByteOut
            <b>NEXT </b>Char
        <b>NEXT </b>Cursor
        <b>RETURN
    
    </b></code>
    or

    Code:
    <code><font color="#000000">Lcd_Data        <b>VAR BYTE </b>[6]
    
    Lcd_Clear:
        PosX=0:PosY=0:<b>GOSUB </b>Lcd_GotoXY
        <b>HIGH </b>Lcd_DC
        Lcd_Data(0)=0:Lcd_Data(1)=0:Lcd_Data(2)=0:Lcd_Data(3)=0:Lcd_Data(4)=0:Lcd_Data(5)=0
        <b>FOR </b>Char=1 <b>TO </b>102
        <b>GOSUB </b>Write_LCD
        <b>NEXT </b>Char
        <b>RETURN
    
    </b>Write_LCD:
        <b>SHIFTOUT </b>SDIN,SCK,1,[ Lcd_Data(0),Lcd_Data(1),Lcd_Data(2),Lcd_Data(3),Lcd_Data(4),Lcd_Data(5) ]
        <b>RETURN
    
    
    </b></code>
    BR,
    -Gusse-

  24. #184
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    571

    Default

    Thank's ! Of course, You are right ! So simple solution...Great !
    Code:
    Lcd_Clear:
    For cursor = 0 to 5
    	PosX=0:PosY=Cursor:Gosub Lcd_GotoXY
    	High Lcd_DC
    
    	For i= 1 to 84
          	Lcd_Data=0:Gosub Lcd_SentByte
          	Lcd_Data=0:Gosub Lcd_SentByte
    	Next i
    Next cursor
    Return

  25. #185
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191

    Default

    Quote Originally Posted by fratello View Post
    Thank's ! Of course, You are right ! So simple solution...Great !
    Nice to hear that it worked.

    BR,
    -Gusse-

  26. #186

    Default 3310 lcd

    hi all
    i am new in this filed plz help me code in Micro Code Studio fore this
    schematic.
    Thanks
    Attached Images Attached Images  
    Last edited by ScaleRobotics; - 13th May 2010 at 15:04. Reason: spam like advertsing on schematic

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

    Default

    Quote Originally Posted by tahirmaqsood View Post
    hi all
    i am new in this filed plz help me code in Micro Code Studio fore this
    schematic.
    Thanks
    Hello tahirmaqsood,

    Your schematic seems to be advertising used cars. I am not sure how any code I could come up would be related to used cars, so I can't really help with the code for the sensors.

    But here is some code for talking to the LCD display:
    http://www.picbasic.co.uk/forum/show...3728#post73728

    Please do not cross post copies of the same question to other threads.

    By the way, are you still using Proton, or have you switched to PicBasicPro?
    Last edited by ScaleRobotics; - 13th May 2010 at 14:32.

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

    Default $2.95 glcd

    The Nokia 3310 display just became available at Sparkfun for $2.95 each. Pretty good price for what it can do! You can check it out here http://www.sparkfun.com/commerce/pro...oducts_id=9924. Here is the wiki page about interfacing it, based on posts in this thread: http://www.picbasic.co.uk/forum/cont...Nokia-3310-LCD
    Last edited by ScaleRobotics; - 5th June 2010 at 06:52.

  29. #189
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    101

    Default @ PrintVar x,y, _anyvariable - example? Having problems...

    Hi Walter,

    Great job on your macro for the Nokia 3310 LCD, so much so that I think I'll move across to using these instead of the 16x2 I've been using everywhere so far. Thank you.

    I'm not having much luck getting the @ PrintVar x,y, _anyvariable to work though. I declare a word variable in my main program (j var word), give it a value to test (j=12345) then
    @ PrintVar 0,4, _j
    but only random values print and only 2 or 3 characters. Weird.

    Can you perhaps show me a working section of how to do it please? I'm using PbP 2.60, 18F252.

    Thanks and regards,
    Bill

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

    Default

    Thanks Bill.

    I double checked the code I posted here: http://www.picbasic.co.uk/forum/cont...Nokia-3310-LCD, and it is working for me. I am using this hardware: http://www.picbasic.co.uk/forum/showthread.php?t=10820 running at 48mhz.

    You are using the right syntax, so I can't really find the problem.

    The PrintVar is how I am printing the word variables in this example: http://www.picbasic.co.uk/forum/cont...-axis-g-sensor

    You want to post your code, and I will see if if runs on my hardware? I don't have an easy way to change my hardware for the display.
    Last edited by ScaleRobotics; - 4th July 2010 at 17:11.

  31. #191
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    101

    Default

    Hi Walter,

    Attached code for the 18F252 also an edited copy of your Include file - only a few small font changes but it's what I'm using so here it is.

    I tried using Variable in place of j but same result. I'm sure it is something simple but I can't see it...

    Thanks for your help,
    Bill
    Attached Files Attached Files

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

    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 19:09.

  33. #193
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    101

    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

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

    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.

  35. #195
    Join Date
    Jun 2005
    Location
    West Australia
    Posts
    101

    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

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

    Default

    Hey Bill,

    I think this might be a version issue for Mpasm, or PBP, but really not sure. I get a nicely compiled result at 2312 words for your version of include file.

    I can fit 96 more bytes in RAM, so there is a bit more left, but as you can see, my program is small.

    Name:  3310-size.PNG
Views: 5908
Size:  62.7 KB
    Last edited by ScaleRobotics; - 12th July 2010 at 06:39.

  37. #197

    Default 3310_lcd_code_lock

    i am new in pbp i want this schematic code in pbp
    and step by step detail this code for learning purpose
    plz any body help me

    Thanks
    Attached Images Attached Images  

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

    Default If you really want to learn...

    Quote Originally Posted by tahirmaqsood View Post
    i am new in pbp i want this schematic code in pbp
    and step by step detail this code for learning purpose
    plz any body help me

    Thanks
    Here you go....

    Step 1: Don't ask people to write all your code for you and expect to learn a thing from it.
    Step 2: Read the manual.
    Step 3: If the project is over your head, start with something you can do, with some work.
    Step 4: Blink some LED's to start off, then try progressing to bigger projects.
    Step 5: Take a look at http://www.picbasic.co.uk/forum/showthread.php?t=12677 for inspiration. Someone working hard and learning fast.

    With time and effort, you will be able to return to the project you are yearning for.

    Walter
    http://www.scalerobotics.com

  39. #199

    Default Re: If you really want to learn...

    hello all,

    i'm trying to compile a program based on 16f628a and nokia LCD 3310.

    I'm trying to right a simple program just to print a HELLO WORLD on the nokia LCD but no luck.

    My problem is that when i try to INCLUDE "LCD_3310v4.inc" i get an error that cannot open the inc file.

    Also when i open the file in the microcode studio (the LCD_3310v4.inc file) i get the error "Symbol not previously defined EEADRH"

    Do you have any suggestion please?

    many thanks for your help in advance.

  40. #200
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191

    Default Re: Using Nokia LCD

    This is causing your EEADRH problem.
    Code:
    Readcode Addr, Char
    Easiest way to go forward is comment or remove following parts of the code:
    Code:
    @ printstr macro function from Darrel and edited to work for this lcd
    'format should look like this: @ PrintStr x,y, "your text string goes here"
    Meaning StringOut and ASM-part above it.
    This is disabling string printing function, so you should figure out other ways to put stuff on LCD.

    Those who know better why READCODE doesn't work with 628A could answer to you.
    Even better if some workaround is available.

    BR,
    -Gusse-
    Last edited by Gusse; - 2nd June 2011 at 22:52. Reason: Just editing

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