Display graphical font using Nokia3310LCD


Closed Thread
Results 1 to 14 of 14
  1. #1
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223

    Default Display graphical font using Nokia3310LCD

    Hi everyone!
    I managed to run a demo application by Steve using the NokiaGLCD wrapper(http://www.picbasic.co.uk/forum/show...ght=3310+Nokia).
    Here is the sample code I'm uisng..
    Code:
            '--------------------------------< HelloWorld_16F877 >--------------------------------------
            '
            '       File name  : HelloWorld_16F877.pbp
            '       Version    : 1.0
            '       Company    : Mister E 
            '       Programmer : Steve Monfette
            '       Date       : JULY 27, 2011
            '       Device     : PIC16F877 @20MHz
            '
            '-------------------------------------------------------------------------------------------                    
                    
            '---------------------------< Project description >-----------------------------------------
            '
            '       Basic code example to display the usual Hello World on the NOKIA GLCD.
            '       This also show how to declare/use some of the GLCD_NOKIA.PBP Defines
            '
            '       Compile: 1057 words
            '-------------------------------------------------------------------------------------------                
          
            '
            '       Pic Configuration
            '       =================
    '@       __CONFIG _HS_OSC & _WDT_OFF & _PWRTE_ON & _BODEN_ON & _LVP_OFF   
            DEFINE OSC 20   
            '                      
            '       Hardware assignment & configuration
            '       ===================================
            		'
            		'		GLCD
            		'		----
                            ' those are not needed as they're exactly the default one, 
                            ' but it show how to use/declare them.
            		DEFINE GLCD_SCE   PORTB,4 		
            		DEFINE GLCD_RES	  PORTB,3
            		DEFINE GLCD_DC    PORTB,5
            		DEFINE GLCD_SDO	  PORTB,6
                    DEFINE GLCD_CLK	  PORTB,7
                    DEFINE GLCD_CONTRAST 65				    
            		DEFINE GLCD_TEMPERATURE_COEFFICIENT 2  	
            		DEFINE GLCD_BIAS 3	                
                    '   
                    '       PORT
                    '       ----
                    TRISB = 0 ' By default the Driver will use PORTB... all output to these then
                    PORTB = 0 ' clear the output/reset the GLCD  
    
    
            '
            '       Includes
            '       ========                       
            INCLUDE "..\Include\GLCD_NOKIA.PBP"    ' Plug the Nokia Driver/Wrapper in here
            '
            '------------------------------< Main program >---------------------------------------------
            '
            ASM
            GLCD_CLS     ; Clear the screen (if not initialized yet, it will do automatically)
            GLCDOUT_AT?STR 0,0,"Hello World!"   ; Show String on Line 0
            ENDASM
    
    
    Here:   GOTO Here   ' sit & spin   
            '
            '-------------------------------------------------------------------------------------------
    My question is how can I display a font like the one below(please see attached image) this the hex equivalent...
    $08, $E0, $00, $E2, $01, $EE, $02, $62, $02, $06, $02, $0E, $03, $FC, $01, $F0, $01, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; for letter m
    Hope anyone can give me a hint on this.

    Thanks in advance,
    tacbanon
    Name:  GLCD_Font.gif
Views: 1107
Size:  5.5 KB

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


    Did you find this post helpful? Yes | No

    Default Re: Display graphical font using Nokia3310LCD

    Open the Include and check out ADDCUSTOMCHAR macro. That should be easy enough for a single character. If you want to build a whole new font set, then check the TABLE_SYMBOLS etc etc sections.

    Refer to HelloWorld_2_16F877.pbp
    Last edited by mister_e; - 15th April 2012 at 19:56.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default Re: Display graphical font using Nokia3310LCD

    Also check out the Readme.txt file located in ...NokiaGlcd\Document folder. There's a short example how to use ADDCUSTOMCHAR macro.
    Steve

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

  4. #4
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Display graphical font using Nokia3310LCD

    Thanks Steve for the response, I'm still figuring it out how it works(by trial and error ) and learn it in the process..I will post here my result.

    regards,
    tacbanon

  5. #5
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Display graphical font using Nokia3310LCD

    I'm still stuck with this simple code I modified from Steve's NokiaGlcd examples..
    Code:
    	DEFINE GLCD_CHAR_IN_EEPROM			   ' store/read character/lookuptable to/from EEPROM
    		DEFINE GLCD_STRING_IN_EEPROM		   ' store/read string to/from EEPROM
    		DEFINE GLCD_USE_SPECIFIC_CHARACTER	   ' We will define our own set of character to be used
            INCLUDE "..\Include\GLCD_NOKIA.PBP"    ' Plug the Nokia Driver/Wrapper in here
    		ASM
    		CHARTABLESTART
    				ADDCUSTOMCHAR CHR_CUSTOM_0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    				ADDCHAR 'e'
    				ADDCHAR 'l'
    				ADDCHAR 'o'
    				ADDCHAR 'w'
    				ADDCHAR 'r'
    				ADDCHAR 'd'
    				ADDCHAR '!' 
    		CHARTABLEEND
    		ENDASM        
            
            '
            '------------------------------< Main program >---------------------------------------------
            '
            ASM
            GLCD_CLS     ; Clear the screen (if not initialized yet, it will do automatically)
            GLCDOUT_AT?STR 0,0,"Hello World!"   ; Show String on Line 0
            GLCDOUT_AT?STR 0,1,"Wello World!"   ; Show String on Line 1
            GLCDOUT_AT?STR 0,2,"j"   ; Show String on Line 2
          
            ENDASM
    
    
    Here:
    
    
    GOTO Here   ' sit & spin
    as I understood characters not defined within CHARTABLESTART and CHARTABLEEND will not be displayed...but I'm still having trouble displaying this character (j) 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    any idea what I'm missing?

    regards,
    tacbanon

    Name:  GLCD_Font_Err2.gif
Views: 1173
Size:  41.1 KB

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


    Did you find this post helpful? Yes | No

    Default Re: Display graphical font using Nokia3310LCD

    read again the readme.txt file example ...

    you have 2 extra argument in ADDCUSTOMCHAR, here you should have
    ADDCUSTOMCHAR CHR_CUSTOM_0, 0x04, 0x00, 0x00, 0x00, 0x00
    not
    ADDCUSTOMCHAR CHR_CUSTOM_0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    Steve

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

  7. #7
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Display graphical font using Nokia3310LCD

    it compiled with no problem now, but custom character won't display on the lcd, probably I'm still doing it wrong..
    I'm expecting a letter 'j' in the 3rd row.
    Code:
    	DEFINE GLCD_CHAR_IN_EEPROM			   ' store/read character/lookuptable to/from EEPROM
    		DEFINE GLCD_STRING_IN_EEPROM		   ' store/read string to/from EEPROM
    		DEFINE GLCD_USE_SPECIFIC_CHARACTER	   ' We will define our own set of character to be used
            INCLUDE "..\Include\GLCD_NOKIA.PBP"    ' Plug the Nokia Driver/Wrapper in here
    		ASM
    		CHARTABLESTART
    				ADDCUSTOMCHAR CHR_CUSTOM_0, 0x04, 0x00, 0x00, 0x00, 0x00
    				ADDCHAR 'e'
    				ADDCHAR 'l'
    				ADDCHAR 'o'
    				ADDCHAR 'w'
    				ADDCHAR 'r'
    				ADDCHAR 'd'
    				ADDCHAR '!' 
    		CHARTABLEEND
    		ENDASM        
            
            '
            '------------------------------< Main program >---------------------------------------------
            '
            ASM
            GLCD_CLS     ; Clear the screen (if not initialized yet, it will do automatically)
            GLCDOUT_AT?STR 0,0,"Hello World!"   ; Show String on Line 0
            GLCDOUT_AT?STR 0,1,"Wello World!"   ; Show String on Line 1
            GLCDOUT_AT?STR 0,2,"j"   ; Show 'j' on Line 2
          
            ENDASM
    
    
    Here:
    
    
    GOTO Here   ' sit & spin
    I appreciate the time for helping out.

    regards,
    tacbanon
    Name:  GLCD_Font_Err3.gif
Views: 1219
Size:  278.0 KB

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


    Did you find this post helpful? Yes | No

    Default Re: Display graphical font using Nokia3310LCD

    You'll see a J once you'll add it in the character you want to use.... no coincidence why you don't have the H nor the W either

    Again it's all explained in the Readme.txt file...
    Steve

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

  9. #9
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Angry character not displaying correctly to the glcd

    I'm trying to display a 10x11 font size "w" but not displaying right to the lcd...(sorry if I'm very slow catching up )
    Code:
    	DEFINE GLCD_CHAR_IN_EEPROM			   ' store/read character/lookuptable to/from EEPROM
    		DEFINE GLCD_STRING_IN_EEPROM		   ' store/read string to/from EEPROM
    		DEFINE GLCD_USE_SPECIFIC_CHARACTER	   ' We will define our own set of character to be used
    		
            INCLUDE "..\Include\GLCD_NOKIA.PBP"    ' Plug the Nokia Driver/Wrapper in here
    		ASM
    	
    						CHARTABLESTART
    								ADDCHAR 'T'
    								ADDCHAR 'E'
    								ADDCHAR 'X'
    								ADDCHAR 'a'
    								ADDCHAR 'b'
    								ADDCHAR '!' 
    								ADDCHAR CHR_NUMBERS
    								ADDCUSTOMCHAR CHR_CUSTOM_0,0x04,0x88,0x01,0x48,0x01
    								ADDCUSTOMCHAR CHR_CUSTOM_1,0x28,0x01,0x18,0x01,0x00
    								ADDCUSTOMCHAR CHR_CUSTOM_2,0x00,0x00,0x00,0x00,0x00
    								ADDCUSTOMCHAR CHR_CUSTOM_3,0x00,0x00,0x00,0x00,0x00
    								ADDCUSTOMCHAR CHR_CUSTOM_4,0x00,0x00,0x00,0x00,0x00
    						CHARTABLEEND
    					
    		ENDASM        
            
            '
            '------------------------------< Main program >---------------------------------------------
           ASM
            GLCD_CLS     ; Clear the screen (if not initialized yet, it will do automatically)
            GLCDOUT_AT?CHR 1,0,CHR_CUSTOM_0 
            GLCDOUT_AT?CHR 2,1,CHR_CUSTOM_1  ; Show String on Line 0
            GLCDOUT_AT?CHR 3,2,CHR_CUSTOM_2
            GLCDOUT_AT?CHR 4,3,CHR_CUSTOM_3
            GLCDOUT_AT?CHR 5,4,CHR_CUSTOM_4      
           ENDASM
    
    
    
    
    Here:
    
    
    GOTO Here   ' sit & spin   
            '
    Name:  GLCD_Font_Err4.gif
Views: 1170
Size:  56.0 KB

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


    Did you find this post helpful? Yes | No

    Default Re: Display graphical font using Nokia3310LCD

    Code:
            '
            '       Includes
            '       ========                       
            DEFINE GLCD_CHAR_IN_EEPROM               ' store/read character/lookuptable to/from EEPROM
            DEFINE GLCD_STRING_IN_EEPROM           ' store/read string to/from EEPROM
            define GLCD_CHAR_6X8
            DEFINE GLCD_USE_SPECIFIC_CHARACTER       ' We will define our own set of character to be used
            INCLUDE "..\Include\GLCD_NOKIA.PBP"    ' Plug the Nokia Driver/Wrapper in here
            ASM
            
                    CHARTABLESTART
                            ADDCHAR 'T'
                            ADDCHAR 'E'
                            ADDCHAR 'X'
                            ADDCHAR 'a'
                            ADDCHAR 'b'
                            ADDCHAR '!' 
                            ADDCHAR CHR_NUMBERS
                            ADDCUSTOMCHAR CHR_CUSTOM_0,0x78,0x80,0x60,0x18,0x60,0x80 ;
                            ADDCUSTOMCHAR CHR_CUSTOM_1,0x78,0x00,0x00,0x00,0x00,0x00 ;
                            ADDCUSTOMCHAR CHR_CUSTOM_2,0x00,0x01,0x00,0x00,0x00,0x01 ;
                            ADDCUSTOMCHAR CHR_CUSTOM_3,0x00,0x00,0x00,0x00,0x00,0x00 ;
                    CHARTABLEEND
                        
            ENDASM        
            
            '
            '------------------------------< Main program >---------------------------------------------
            ASM
                    GLCD_CLS     ; Clear the screen (if not initialized yet, it will do automatically)
                    GLCDOUT_AT?CHR 0,0,CHR_CUSTOM_0 
                    GLCDOUT_AT?CHR 1,0,CHR_CUSTOM_1  
                    GLCDOUT_AT?CHR 0,1,CHR_CUSTOM_2
                    GLCDOUT_AT?CHR 1,1,CHR_CUSTOM_3
                    GLCDOUT_AT?STR 5,6,"TEXT!"   
            ENDASM
    Steve

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

  11. #11
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Display graphical font using Nokia3310LCD

    Finally got it...thanks for the help.
    Name:  Nokia3310LCD.jpg
Views: 1028
Size:  60.9 KB

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


    Did you find this post helpful? Yes | No

    Default Re: Display graphical font using Nokia3310LCD

    Way cool

    Thanks and Enjoy!
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default Re: Display graphical font using Nokia3310LCD

    Hi Tacbanon,

    Did you manage to create bigger fonts with Steve's program?

    I see your last post shows the display with obvious different font but still within the 6x8 field. How does one make a larger font exceeding this area?

    I'd appreciate your help and maybe a snippet of code if you've been successful. My aim is to make really big fonts (0-9, +, -, decimal point mid-height, C, F and degree symbol) in a 12x16 or 4 normal character size locations (7 chars per line, 3 lines) on the Nokia LCD using Steve's excellent wrapper. If it can't be done I can do other mapping but then lose Mister_e's utility.

    Steve if you're around perhaps you'd like to add some comments also? All help appreciated.

    Regards to all,
    Bill

  14. #14
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Display graphical font using Nokia3310LCD

    Hello Bill, sorry to tell you that I have not able to create a bigger fonts using Steve's GLCD...

    Regards,
    tacbanon

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