Nokia lcd include , small footprint to suit pic16's


Closed Thread
Results 1 to 40 of 111

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    some pics of the big fnt
    Attached Images Attached Images   
    Warning I'm not a teacher

  2. #2
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    Nice work, Richard. This stuff is addicting...

    I worked through my problems with XC8 and have put aside the "minimal overhead" 5x7 project for now (stopping at 370 words total). Now I'm lookin' at bigger fonts, too, and a driver that can use an hpos (0..83) and vpos (0..47) starting point for drawing characters.

    I looked at someone's 11x16 font (below left) but I don't like it as much as a 10x14 font from Noritake-Itron (below right). I think I'd like to use the Noritake font as a starting point and reduce the character size slightly to allow for descenders on a few select lower case characters.

    Take care... Have fun... Regards, Mike
    Attached Images Attached Images   
    Last edited by Mike, K8LH; - 28th May 2018 at 18:45.

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    Quote Originally Posted by richard View Post
    some pics of the big fnt
    May I ask for that magic excel file please?

    Ioannis

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    May I ask for that magic excel file please?
    all the magic is done with conditional formatting , a 1 in a field turns it black ,an empty field is blank
    make sure no field is greater than 1 or the math is incorrect

    complete number font
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by richard; - 29th May 2018 at 00:05.
    Warning I'm not a teacher

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


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    Great work Richard, I hope Mike has success also we can learn from.

    Speaking of... will there be a PBP version arriving anytime soon? Knowing zero languages other than PBP (and I'm still an infant here) I marvel at what you experts can achieve and am quite envious

    Kind regards,
    Bill

    PS
    no time at present to test your reply to my last problem, hopefully the weekend will allow.

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    will there be a PBP version arriving anytime soon?
    don't hold your breath , since pbp has no pointer variable type its a bit tedious to code

    and a driver that can use an hpos (0..83) and vpos (0..47) starting point for drawing characters.
    maybe ART will grace us with some of his framebuffer code , I think a 504 byte buffer is not out of the question on a 16f1847
    Warning I'm not a teacher

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    latest iteration
    frame buffer, bitmap graphics, left/right scrolling, text at any x,y offset
    Attached Images Attached Images  
    Attached Files Attached Files
    Warning I'm not a teacher

  8. #8
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    Quote Originally Posted by richard View Post
    all the magic is done with conditional formatting , a 1 in a field turns it black ,an empty field is blank
    make sure no field is greater than 1 or the math is incorrect

    complete number font
    Great! Never thought of that!

    Thanks Richard.
    Ioannis

  9. #9
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    Nice work, Richard. Bravo!

    I finally imported that Noritake 10x14 Font into Excel today. It took a bit of work. The Noritake Font file was 1920 separate "retlw 0x00" type lines. Not an ideal format for importing into Excel so I wrote a quick JustBASIC program to generate 96 lines with 10 comma separated words per line. After importing that file into Excel I discovered that Noritake maps the b15 bit to row 0 with the b0 bit all the way down at row 15 so I modified my JustBASIC program to exchange the bit order and finally got the Font into Excel. Whew!

    Name:  Font Viewer 10x14 (small).png
Views: 7671
Size:  151.7 KB

    Code:
    '
    '  Noritake 10x14 Font Table Converter    30-May-2018, Mike McLaren
    '
    '  Reads the 1920 line one-hex-byte-at-a-time Noritake Font file and
    '  reformats it as 96 lines (one line per character), 10-words-per-line,
    '  reversed bit order (row 0 = bit 0), and as CSV text for Excel import.
    '  Does not alter the source file.
    '
    '  Instructions
    '
    '  1 - select the Noritake 10x14 text file from the File Dialog
    '  2 - output text displayed in console window
    '  3 - select text and copy to clipboard using <ctrl-C> or <edit> <copy>
    '  4 - paste into your spreadsheet (use text import tool)
    '
    '  JustBASIC v1.01
    '
    
       filedialog "Source File?", "*.txt", fileName$            '
       output$ = "hex"                                          ' select "dec" or "hex"
       if fileName$ <> "" then                                  '
         open fileName$ for input as #f                         '
         while eof(#f) > -1                                     '
           for asciichar = 32 to 127                            ' 96 characters (32..127)
             for n = 1 to 10                                    ' 10 words per line
             '
             ' read in an MSB and an LSB line ('       retlw   0x00') and turn them into
             ' a single decimal or hexidecimal word ('0x0000' or '00000') with a comma
             ' delimiter for CSV (comma separated value) import into Excel.
             '
               line input #f, aLine$: line input #f, bLine$     '
             '
             ' reverse bit order...  Noritake uses row 0 = b15 but we want row 0 = b0
             '
               dec = hexdec(aLine$+right$(bLine$,2))            ' convert hex to decimal
               dec = xcgbits(dec)                               ' exchange bit order
             '
               if (output$ = "dec") then                        ' if "dec" output
                 if (dec < 10000) then print " ";               ' print "dec" value
                 if (dec < 1000) then print " ";                '  "
                 if (dec < 100) then print " ";                 '  "
                 if (dec < 10) then print " ";                  '  "
                 print dec;                                     '  "
               else                                             ' else
                 print "0x";                                    ' print "hex" value
                 print dechex$(dec);                            '  "
               end if                                           '
               print ", ";                                      ' print separator
               if (n = 10) then                                 ' if last word in line
                 if (asciichar < 100) then print " ";           ' print ascii, 32..127
                 print asciichar;: print " ";                   '  "
                 print "'";:print chr$(asciichar);: print "'"   ' print ascii character
               end if                                           '
    
             next n
           next asciichar                                       ' next character line
           print                                                '
         wend
         close #f
       end if
    
       end
    
    '
    ' Converts hexadecimal number (string) to decimal number.
    ' Processes the hex number from right to left, so any hex notation is allowed.
    ' Examples: &hFF = 0xFF = FF
    '
    function hexdec(HexString$)
      Hex$ = "0123456789ABCDEF"
      power = 0
      hexdec = 0
    
      for i = len(HexString$) to 1 step -1
        HexDigit$ = upper$(mid$(HexString$, i, 1))
      '
      ' exit at first non-hexadecimal digit
      '
        if instr(Hex$, HexDigit$) = 0 then exit for
        hexdec = hexdec + ((instr(Hex$, HexDigit$) - 1) * (16^power))
        power = power + 1
      next
    end function
    
    '
    ' convert decimal number to 4-digit hexidecimal string
    '
    function dechex$(DecValue)
      Hex$ = "0123456789ABCDEF"
      dechex$ = ""
      for power = 3 to 0 step -1
        digitndx = int(DecValue/16^power)
        DecValue = DecValue - digitndx*16^power
        dechex$ = dechex$ + mid$(Hex$,digitndx+1,1)
      next power
    end function
    
    '
    ' exchange bit order b15<>b0, b14<>b1, b13<>b2, ...
    '
    function xcgbits(decval)
      xcgbits = 0
      newpwr = 0
      for power = 15 to 0 step -1
        if (decval >= 2^power) then
          decval = decval - 2^power
          xcgbits = xcgbits + 2^newpwr
        end if
        newpwr = newpwr + 1
      next power
    end function
    If you need it, here's the converted "decimal" version of the Noritake 10x14 Font in CSV format for Excel;

    Code:
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,  32 ' '
        0,     0,     0,     0, 13311, 13311,     0,     0,     0,     0,  33 '!'
        0,     0,    15,    15,     0,     0,    15,    15,     0,     0,  34 '"'
      816,   816, 16383, 16383,   816,   816, 16383, 16383,   816,   816,  35 '#'
     1584,  3704,  3324,  3276, 16383, 16383,  3276,  4044,  1948,   792,  36 '$'
        6, 12303, 15375,  3846,   960,   240,  6204, 15375, 15363,  6144,  37 '%'
     3900,  8190, 14531, 12771, 13299, 14139,  7710,  3084, 16128, 13056,  38 '&'
        0,     0,     0,    34,    55,    31,    14,     0,     0,     0,  39 '''
        0,     0,  1008,  4092,  7710,  6150, 12291, 12291,     0,     0,  40 '('
        0,     0, 12291, 12291,  6150,  7710,  4092,  1008,     0,     0,  41 ')'
     1584,  1904,   992,   448,  8188,  8188,   448,   992,  1904,  1584,  42 '*'
      192,   192,   192,   192,  4092,  4092,   192,   192,   192,   192,  43 '+'
     8704, 14080,  7936,  3584,     0,     0,     0,     0,     0,     0,  44 ','
      192,   192,   192,   192,   192,   192,   192,   192,   192,   192,  45 '-'
     6144, 15360, 15360,  6144,     0,     0,     0,     0,     0,     0,  46 '.'
        0, 12288, 15360,  3840,   960,   240,    60,    15,     3,     0,  47 '/'
     4092,  8190, 16135, 13187, 12739, 12515, 12403, 14399,  8190,  4092,  48 '0'
        0,     0, 12300, 12302, 16383, 16383, 12288, 12288,     0,     0,  49 '1'
    12300, 14350, 15367, 15875, 14083, 13187, 12739, 12519, 12414, 12348,  50 '2'
     3084,  7182, 14343, 12291, 12291, 12483, 12483, 14535,  8190,  3900,  51 '3'
      960,   992,   880,   824,   796,   782, 16383, 16383,   768,   768,  52 '4'
     3135,  7231, 14387, 12339, 12339, 12339, 12339, 14451,  8163,  4035,  53 '5'
     4092,  8190, 14535, 12483, 12483, 12483, 12483, 14791,  8078,  3852,  54 '6'
        3,     3,     3,     3, 16323, 16355,   115,    59,    31,    15,  55 '7'
     3900,  8190, 14823, 12483, 12483, 12483, 12483, 14823,  8190,  3900,  56 '8'
       60,   126, 12519, 12483, 14531,  7363,  3779,  2023,  1022,   508,  57 '9'
        0,     0,     0,  1560,  3900,  3900,  1560,     0,     0,     0,  58 ':'
        0,     0,     0,  8728, 14140,  7996,  3608,     0,     0,     0,  59 ';'
        0,   192,   480,  1008,  1848,  3612,  7182, 14343, 12291,     0,  60 '<'
      816,   816,   816,   816,   816,   816,   816,   816,   816,   816,  61 '='
        0, 12291, 14343,  7182,  3612,  1848,  1008,   480,   192,     0,  62 '>'
       12,    14,     7,     3, 14211, 14275,   195,   103,   126,    60,  63 '?'
     3852,  8078, 14791, 12483, 16323, 16323, 12291, 14343,  8190,  4092,  64 '@'
    16380, 16382,   775,   771,   771,   771,   771,   775, 16382, 16380,  65 'A'
    16383, 16383, 12483, 12483, 12483, 12483, 12483, 14823,  8190,  3900,  66 'B'
     4092,  8190, 14343, 12291, 12291, 12291, 12291, 14343,  7182,  3084,  67 'C'
    16383, 16383, 12291, 12291, 12291, 12291, 12291, 14343,  8190,  4092,  68 'D'
    16383, 16383, 12483, 12483, 12483, 12483, 12483, 12483, 12291, 12291,  69 'E'
    16383, 16383,   195,   195,   195,   195,   195,   195,     3,     3,  70 'F'
     4092,  8190, 14343, 12291, 12291, 12483, 12483, 14535,  8142,  4044,  71 'G'
    16383, 16383,   192,   192,   192,   192,   192,   192, 16383, 16383,  72 'H'
        0,     0, 12291, 12291, 16383, 16383, 12291, 12291,     0,     0,  73 'I'
     3072,  7168, 14339, 12291, 12291, 14339,  8191,  4095,     3,     3,  74 'J'
    16383, 16383,   480,   480,  1008,  1848,  3612,  7182, 14343, 12291,  75 'K'
    16383, 16383, 12288, 12288, 12288, 12288, 12288, 12288, 12288, 12288,  76 'L'
    16383, 16383,    14,    28,   248,   248,    28,    14, 16383, 16383,  77 'M'
    16383, 16383,    56,   112,   224,   448,   896,  1792, 16383, 16383,  78 'N'
     4092,  8190, 14343, 12291, 12291, 12291, 12291, 14343,  8190,  4092,  79 'O'
    16383, 16383,   195,   195,   195,   195,   195,   231,   126,    60,  80 'P'
     4092,  8190, 14343, 12291, 13059, 14083, 15875,  7175, 16382, 14332,  81 'Q'
    16383, 16383,   195,   451,   451,   963,   963,  3815, 15486, 14396,  82 'R'
     6204, 14462, 12519, 12483, 12483, 12483, 12483, 14787,  8071,  3846,  83 'S'
        3,     3,     3,     3, 16383, 16383,     3,     3,     3,     3,  84 'T'
     4095,  8191, 14336, 12288, 12288, 12288, 12288, 14336,  8191,  4095,  85 'U'
     1023,  2047,  3584,  7168, 14336, 14336,  7168,  3584,  2047,  1023,  86 'V'
     4095,  8191, 14336, 15360,  7936,  7936, 15360, 14336,  8191,  4095,  87 'W'
    15375, 15903,  1848,  1008,   480,   480,  1008,  1848, 15903, 15375,  88 'X'
       63,   127,   224,   448, 16256, 16256,   448,   224,   127,    63,  89 'Y'
    15363, 15875, 14083, 13187, 12739, 12515, 12403, 12347, 12319, 12303,  90 'Z'
        0,     0, 16383, 16383, 12291, 12291, 12291,     0,     0,     0,  91 '['
       12,    12,    48,    48,   192,   192,   768,   768,  3072,  3072,  92 '\'
        0,     0, 12291, 12291, 12291, 16383, 16383,     0,     0,     0,  93 ']'
       48,    56,    28,    14,     7,     7,    14,    28,    56,    48,  94 '^'
    12288, 12288, 12288, 12288, 12288, 12288, 12288, 12288, 12288, 12288,  95 '_'
        0,     0,     3,     7,    14,    28,    24,     0,     0,     0,  96 '`'
     3072,  7776, 16240, 13104, 13104, 13104, 13104, 13168, 16352,  8128,  97 'a'
    16383, 16383, 12480, 12480, 12480, 12480, 12480, 14784,  8064,  3840,  98 'b'
     4032,  8160, 14448, 12336, 12336, 12336, 12336, 14448,  7392,  3264,  99 'c'
     3840,  8064, 14784, 12480, 12480, 12480, 12480, 12480, 16383, 16383, 100 'd'
     4032,  8160, 15216, 13104, 13104, 13104, 13104, 15216,  7136,  2496, 101 'e'
        0,   192, 16380, 16382,   199,   199,    14,    12,     0,     0, 102 'f'
     6336, 14816, 13296, 13104, 13104, 13104, 13104, 15152,  8176,  4064, 103 'g'
    16383, 16383,   192,   192,   192,   192,   448, 16256, 16128,     0, 104 'h'
        0,     0,     0,     0, 16344, 16344,     0,     0,     0,     0, 105 'i'
        0,  3072,  7168, 14336, 12288, 12288, 14336,  8179,  4083,     0, 106 'j'
        0, 16383, 16383,  1792,  1920,  4032,  7392, 14448, 12336,     0, 107 'k'
        0,     0, 12291, 12291, 16383, 16383, 12288, 12288,     0,     0, 108 'l'
    16368, 16368,   112,   224,   960,   960,   224,   112, 16368, 16368, 109 'm'
    16368, 16368,   192,   224,   112,    48,    48,   112, 16352, 16320, 110 'n'
     4032,  8160, 14448, 12336, 12336, 12336, 12336, 14448,  8160,  4032, 111 'o'
    16368, 16368,   816,   816,   816,   816,   816,  1008,   480,   192, 112 'p'
      192,   480,  1008,   816,   816,   816,   816,   816, 16368, 16368, 113 'q'
    16368, 16368,   448,   224,   112,    48,    48,   112,   224,   192, 114 'r'
     6336, 14816, 13296, 13104, 13104, 13104, 13104, 16176,  7792,  3168, 115 's'
        0,    48,    48,  4095,  8191, 14384, 14384,  7216,  3120,     0, 116 't'
     4080,  8176, 14336, 12288, 12288, 12288, 12288, 14336,  8176,  4080, 117 'u'
     1008,  2032,  3584,  7168, 14336, 14336,  7168,  3584,  2032,  1008, 118 'v'
     4080,  8176, 14336, 14336,  7936,  7936, 14336, 14336,  8176,  4080, 119 'w'
    12336, 14448,  7392,  4032,  1920,  1920,  4032,  7392, 14448, 12336, 120 'x'
       48,   112, 12512, 14784,  8064,  3968,   448,   224,   112,    48, 121 'y'
    12336, 14384, 15408, 15920, 14128, 13232, 12784, 12528, 12400, 12336, 122 'z'
        0,   192,   480,  4092,  7998, 14343, 12291, 12291, 12291,     0, 123 '{'
    12480, 12480, 16380, 16382, 12487, 12483, 12291, 12295, 12302, 12300, 124 '|'
        0, 12291, 12291, 12291, 14343,  7998,  4092,   480,   192,     0, 125 '}'
        3,     3,     3,     3,     3,     3,     3,     3,     3,     3, 126 '~'
    16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383, 16383, 127 ''
    Last edited by Mike, K8LH; - 31st May 2018 at 02:47.

  10. #10
    Join Date
    Aug 2005
    Location
    Michigan, USA
    Posts
    224


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    Richard, here's something fun... Someone over on the MrExcel forum helped me with a VBA macro that allows you to toggle the value in a cell within your 10x16 matrix between "null" and "1" by simply clicking on it. The attached file is your spreadsheet with macros enabled (xlsm rather than xlsx file extension). I'm not sure if you have to enable "developer" mode in Excel or not, but give it a try...

    Cheerful regards, Mike

    Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    'Modified 5/30/18 9:50 PM EDT
    If Not Intersect(Target, Range("B30:K45")) Is Nothing Then
      If Target.Cells.CountLarge > 1 Then Exit Sub
        If Target.Value = "1" Then
          Target.Value = ""
        Else
          Target.Value = "1"
      End If
      Range("b28").Select
    End If
    End Sub
    Attached Files Attached Files
    Last edited by Mike, K8LH; - 31st May 2018 at 05:05.

  11. #11
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    thanks mike , its just whats needed and works perfectlty
    Warning I'm not a teacher

  12. #12
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    doesn't the demo show that with the contrast and backlight stuff ?
    what have you tried ?
    Warning I'm not a teacher

  13. #13
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    I havent tried the demo. Just download the txt.

    As far as i understant it is using the command

    ARRAYWRITE BUFF [dec C,0]
    LCDSTR x,y, buff



    i tried and it worked.

    a = 1
    b = 2
    c = a+b
    Last edited by astanapane; - 29th August 2020 at 10:03.

  14. #14
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    have you read the pbp manual and understood the syntax for
    Output Modifiers for Formatting Strings using arraywrite ?

    its all there
    Warning I'm not a teacher

  15. #15
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    Hi Richard,

    my fault, yes i have read the arraywrite - arrayread command and corrected the code in my previous edited message.

    Many thanks.

  16. #16
    Join Date
    Oct 2010
    Posts
    413


    Did you find this post helpful? Yes | No

    Default Re: Nokia lcd include , small footprint to suit pic16's

    i have a question regarding the library and the code for the nokia 3310.

    for the following code:

    Code:
    ARRAYWRITE speed [dec var1,dec2 var2,0]
    LCDSTR x,y, buff
    VAR1 is a byte and VAR2 is a byte as well. Those two numbers are presenting the Speed in format VAR1,VAR2 (where VAR1 can be any number from 0 to infinity, and VAR2 can be any number from 0 to 99)

    In case that the VAR1 gets the variable from 0 to =<255 the it can be used as a byte.

    My problem is that i need this floating number for ex. speed = 50,86 to get it as an integer speed = 5086. May i have your help please?

    If i set speed (VAR1 VAR2) as word then the following command

    Code:
    LCDSTR x,y, speed
    does not accept word.

    Could you please help me to get the speed as an integer and read it as it is.

    For my program i'm testing:

    Code:
    if speed is > 5086 then limit ; 50,86
    thanks once again.
    Last edited by astanapane; - 4th September 2020 at 10:18.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. 16F946 pcb footprint (64 tqfp)
    By nomad in forum Schematics
    Replies: 2
    Last Post: - 8th September 2009, 11:14
  3. small 2X16 LCD
    By Ron Marcus in forum Off Topic
    Replies: 2
    Last Post: - 26th October 2007, 20:37
  4. Nokia 3310 LCD
    By barkerben in forum General
    Replies: 3
    Last Post: - 10th December 2005, 19:08
  5. Small LCD module,character
    By Ron Marcus in forum Off Topic
    Replies: 6
    Last Post: - 27th November 2005, 18:13

Members who have read this thread : 3

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